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

File Contents

# User Rev Content
1 couturad 919 #include "mstruct_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 919 #include "mg_cg_modele.h"
12     #include "mg_cg_assemblage.h"
13     #include "mg_sous_geometrie.h"
14     #include "mg_cg_forme_multi_volume.h"
15 couturad 937 #include "mg_cg_info.h"
16 couturad 919 #include "mg_file.h"
17     #include "fct_taille_fem_solution_generateur_microstructure.h"
18 couturad 951 #include "mailleur3d_couche.h"
19 couturad 919 #include "mailleur0d.h"
20     #include "mailleur1d.h"
21     #include "mailleur2d.h"
22     #include "mailleur3d.h"
23     #include "mailleur_fem.h"
24     #include "mailleur_analyse.h"
25     #include <fstream>
26     #include "mgaster.h"
27     #include "ot_cpu.h"
28     #include "mstruct_outils.h"
29 couturad 926 #include "mg_cg_groupe_forme.h"
30     #include "mstruct_ves_file.h"
31 couturad 933 #include "fem_tetra4.h"
32     #include "fem_tetra10.h"
33     #include "fem_penta6.h"
34     #include "fem_penta15.h"
35 couturad 951 #include "parse.h"
36     #include "pars_argument.h"
37 couturad 926 MSTRUCT_VES::MSTRUCT_VES(void)
38 couturad 919 {
39     m_mg_gestionnaire=new MG_GESTIONNAIRE;
40     m_mg_geometrie=NULL;
41     m_mgcg_modele=NULL;
42 couturad 926 m_mgcg_assemblage=NULL;
43 couturad 919 m_mg_maillage=NULL;
44     m_fem_maillage=NULL;
45 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
46     change_boite_3D_ves(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
47     change_precision(1.0e-06);
48     change_temps_geometrie(0.0);
49     change_temps_carte(0.0);
50     change_temps_maillage(0.0);
51     change_temps_fem_maillage(0.0);
52     change_temps_etude(0.0);
53     change_temps_calcul(0.0);
54     change_temps_analyse(0.0);
55 couturad 919 }
56    
57 couturad 926 MSTRUCT_VES::MSTRUCT_VES(char* fichier_ves)
58 couturad 919 {
59 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
60     m_ves_file->ouvrir(fichier_ves);
61     m_mg_gestionnaire = new MG_FILE(m_ves_file->get_nom_fichier_magic());
62     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());
63     else m_mgcg_modele=NULL;
64     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());
65     else m_mgcg_assemblage=NULL;
66     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());
67     else m_mg_geometrie = NULL;
68     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());
69     else m_mg_maillage = NULL;
70     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());
71     else m_fem_maillage = NULL;
72 couturad 919 }
73    
74 couturad 926 MSTRUCT_VES::~MSTRUCT_VES(void)
75 couturad 919 {
76     delete m_mg_gestionnaire;
77 couturad 926 delete m_ves_file;
78 couturad 919 }
79    
80 couturad 926 MG_GESTIONNAIRE* MSTRUCT_VES::get_mg_gestionnaire(void)
81 couturad 919 {
82     return m_mg_gestionnaire;
83     }
84    
85 couturad 926 void MSTRUCT_VES::change_mg_gestionnaire(MG_GESTIONNAIRE* gest)
86 couturad 919 {
87 couturad 926 m_mg_gestionnaire=gest;
88     }
89    
90     void MSTRUCT_VES::change_mg_geometrie(MG_GEOMETRIE* mg_geometrie)
91     {
92 couturad 919 m_mg_geometrie=mg_geometrie;
93 couturad 926 m_ves_file->change_id_mg_geometrie(m_mg_geometrie->get_id());
94 couturad 919 }
95    
96 couturad 926 MG_GEOMETRIE* MSTRUCT_VES::get_mg_geometrie(void)
97 couturad 919 {
98     return m_mg_geometrie;
99     }
100    
101 couturad 926 void MSTRUCT_VES::change_mgcg_assemblage(MG_CG_ASSEMBLAGE* mgcg_assemblage)
102 couturad 919 {
103     m_mgcg_assemblage=mgcg_assemblage;
104 couturad 926 m_ves_file->change_id_mgcg_assemblage(m_mgcg_assemblage->get_id());
105 couturad 919 }
106    
107 couturad 926 MG_CG_ASSEMBLAGE* MSTRUCT_VES::get_mgcg_assemblage(void)
108 couturad 919 {
109     return m_mgcg_assemblage;
110     }
111    
112 couturad 926 void MSTRUCT_VES::change_mgcg_modele(MG_CG_MODELE* mgcg_modele)
113 couturad 919 {
114     m_mgcg_modele=mgcg_modele;
115 couturad 926 m_ves_file->change_id_mgcg_modele(m_mgcg_modele->get_id());
116 couturad 919 }
117    
118 couturad 926 MG_CG_MODELE* MSTRUCT_VES::get_mgcg_modele(void)
119 couturad 919 {
120     return m_mgcg_modele;
121     }
122    
123 couturad 926 MG_MAILLAGE* MSTRUCT_VES::get_mg_maillage(void)
124 couturad 919 {
125     return m_mg_maillage;
126     }
127    
128 couturad 926 void MSTRUCT_VES::change_mg_maillage(MG_MAILLAGE* mg_maillage)
129 couturad 919 {
130     m_mg_maillage=mg_maillage;
131 couturad 926 m_ves_file->change_id_mg_maillage(m_mg_maillage->get_id());
132 couturad 919 }
133    
134 couturad 926 FEM_MAILLAGE* MSTRUCT_VES::get_fem_maillage(void)
135 couturad 919 {
136     return m_fem_maillage;
137     }
138    
139 couturad 926 void MSTRUCT_VES::change_fem_maillage(FEM_MAILLAGE* fem_maillage)
140 couturad 919 {
141     m_fem_maillage=fem_maillage;
142 couturad 926 m_ves_file->change_id_fem_maillage(m_fem_maillage->get_id());
143 couturad 919 }
144    
145 couturad 926 BOITE_3D MSTRUCT_VES::get_boite3d_ves(void)
146 couturad 919 {
147 couturad 926 return m_ves_file->get_boite_3D_ves();
148 couturad 919 }
149    
150 couturad 926 void MSTRUCT_VES::change_boite_3D_ves(BOITE_3D boite3D)
151 couturad 919 {
152 couturad 926 m_ves_file->change_boite_3D_ves(boite3D);
153 couturad 919 }
154    
155 couturad 926 double MSTRUCT_VES::get_precision(void)
156 couturad 919 {
157 couturad 926 return m_ves_file->get_precision();
158 couturad 919 }
159    
160 couturad 926 void MSTRUCT_VES::change_precision(double precision)
161 couturad 919 {
162 couturad 926 m_ves_file->change_precision(precision);
163 couturad 919 }
164    
165 couturad 926 double MSTRUCT_VES::get_temps_geometrie(void)
166 couturad 919 {
167 couturad 926 return m_ves_file->get_temps_geometrie();
168 couturad 919 }
169    
170 couturad 926 void MSTRUCT_VES::change_temps_geometrie(double temps)
171 couturad 919 {
172 couturad 926 m_ves_file->change_temps_geometrie(temps);
173 couturad 919 }
174    
175 couturad 926 double MSTRUCT_VES::get_temps_materiau(void)
176     {
177     return m_ves_file->get_temps_materiau();
178     }
179 couturad 919
180 couturad 926 void MSTRUCT_VES::change_temps_materiau(double temps)
181 couturad 919 {
182 couturad 926 m_ves_file->change_temps_materiau(temps);
183     }
184    
185     double MSTRUCT_VES::get_temps_carte(void)
186     {
187     return m_ves_file->get_temps_carte();
188     }
189    
190     void MSTRUCT_VES::change_temps_carte(double temps)
191     {
192     m_ves_file->change_temps_carte(temps);
193     }
194    
195     double MSTRUCT_VES::get_temps_maillage(void)
196     {
197     return m_ves_file->get_temps_maillage();
198     }
199    
200     void MSTRUCT_VES::change_temps_maillage(double temps)
201     {
202     m_ves_file->change_temps_maillage(temps);
203     }
204    
205     double MSTRUCT_VES::get_temps_fem_maillage(void)
206     {
207     return m_ves_file->get_temps_fem_maillage();
208     }
209    
210     void MSTRUCT_VES::change_temps_fem_maillage(double temps)
211     {
212     m_ves_file->change_temps_fem_maillage(temps);
213     }
214    
215     double MSTRUCT_VES::get_temps_etude(void)
216     {
217     return m_ves_file->get_temps_etude();
218     }
219    
220     void MSTRUCT_VES::change_temps_etude(double temps)
221     {
222     m_ves_file->change_temps_etude(temps);
223     }
224    
225     double MSTRUCT_VES::get_temps_calcul(void)
226     {
227     return m_ves_file->get_temps_calcul();
228     }
229    
230     void MSTRUCT_VES::change_temps_calcul(double temps)
231     {
232     m_ves_file->change_temps_calcul(temps);
233     }
234    
235     double MSTRUCT_VES::get_temps_analyse(void)
236     {
237     return m_ves_file->get_temps_analyse();
238     }
239    
240     void MSTRUCT_VES::change_temps_analyse(double temps)
241     {
242     m_ves_file->change_temps_analyse(temps);
243     }
244    
245     long int MSTRUCT_VES::get_nb_analyse(void)
246     {
247     return m_ves_file->get_nb_analyse();
248     }
249    
250     int MSTRUCT_VES::ajouter_analyse(MSTRUCT_ANALYSE* analyse_ves)
251     {
252     return m_ves_file->ajouter_analyse(analyse_ves);
253     }
254    
255     MSTRUCT_ANALYSE* MSTRUCT_VES::get_premiere_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
256     {
257     return m_ves_file->get_premiere_analyse(it);
258     }
259    
260     MSTRUCT_ANALYSE* MSTRUCT_VES::get_suivante_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
261     {
262     return m_ves_file->get_suivante_analyse(it);
263     }
264    
265 couturad 951 MSTRUCT_ANALYSE* MSTRUCT_VES::get_analyse(std::string identifiant)
266 couturad 926 {
267     return m_ves_file->get_analyse(identifiant);
268     }
269    
270 couturad 951 int MSTRUCT_VES::supprimer_analyse(std::string identifiant)
271 couturad 926 {
272     return m_ves_file->supprimer_analyse(identifiant);
273     }
274    
275     int MSTRUCT_VES::supprimer_tout_analyse(void)
276     {
277     return m_ves_file->supprimer_tout_analyse();
278     }
279    
280     int MSTRUCT_VES::generer_geometrie(std::vector< OT_PARAMETRES* >& vector_params_geometrie)
281     {
282 couturad 919 OT_CPU ot_cpu;
283     ot_cpu.initialise();
284 couturad 951 MSTRUCT_GENERATEUR* generateur=NULL;
285 couturad 919 std::vector<OT_PARAMETRES*>::iterator it;
286     for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++)
287     {
288     OT_PARAMETRES* param = *it;
289 couturad 951 if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT_GENERATEUR::TYPE_GENERATEUR::RSA)
290 couturad 919 {
291     std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
292 couturad 951 MSTRUCT_GENERATEUR_RSA *RSA;
293     if(generateur==NULL)
294     {
295     RSA = new MSTRUCT_GENERATEUR_RSA(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
296     generateur=RSA;
297     RSA->active_affichage(fonc_affiche);
298     }
299    
300 couturad 919 double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
301     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
302     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
303     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
304     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
305     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
306     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
307     Boite3D_distribution_Ymin,
308     Boite3D_distribution_Zmin,
309     Boite3D_distribution_Xmax,
310     Boite3D_distribution_Ymax,
311     Boite3D_distribution_Zmax);
312 couturad 951 RSA->change_boite3d_distribution(Boite3D_distribution);
313 couturad 919 double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
314     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
315 couturad 951 double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
316     RSA->change_nb_pas_grille(Nb_pas_X);
317     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
318     RSA->change_distance_inter_volume_min(Distance_min_inter_volume);
319 couturad 919 double Volume_min = param->get_valeur((char*)"Volume_min");
320 couturad 951 RSA->change_volume_min(Volume_min);
321 couturad 919 double Aire_min = param->get_valeur((char*)"Aire_min");
322 couturad 951 RSA->change_aire_min(Aire_min);
323 couturad 919 double Longueur_min = param->get_valeur((char*)"Longueur_min");
324 couturad 951 RSA->change_longueur_min(Longueur_min);
325 couturad 919 double Angle_min = param->get_valeur((char*)"Angle_min");
326 couturad 951 RSA->change_angle_min(Angle_min);
327 couturad 919 double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max");
328 couturad 951 RSA->change_nb_iteration_max(Nb_iteration_max);
329     bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
330     RSA->change_intersection_bords_ves(Avec_intersections);
331     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
332     int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
333 couturad 919 double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
334 couturad 951 double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
335     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
336     std::string multicouche = param->get_nom((char*)"Multicouche");
337     PARS_ARGUMENT parse_param[100];
338     PARSE parse;
339     parse.decode(multicouche.c_str(),"@,(&)",parse_param);
340     std::vector<double> *vector_epaisseur=NULL;
341     int nb_couche = atoi(parse_param[0].argument[0].c_str());
342     if(nb_couche>0)
343 couturad 919 {
344 couturad 951 vector_epaisseur=new std::vector<double>;
345     for(int i=0;i<nb_couche;i++)
346     {
347     double epaisseur=atof(parse_param[1].argument[i].c_str());
348     vector_epaisseur->push_back(epaisseur);
349     }
350     }
351     if(Type_inclusion==MSTRUCT_GENERATEUR_RSA::TYPE_INCLUSION::SPHERE)
352     {
353 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
354     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
355     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
356     double fraction_volumique_actuelle=0.0;
357     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);
358 couturad 919 }
359 couturad 951 else if(Type_inclusion==MSTRUCT_GENERATEUR_RSA::TYPE_INCLUSION::CYLINDRE)
360 couturad 919 {
361 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
362     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
363     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
364     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
365     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
366     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
367     double Mu_theta = param->get_valeur((char*)"Mu_theta");
368     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
369     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
370     double Mu_phi = param->get_valeur((char*)"Mu_phi");
371     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
372     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
373     double fraction_volumique_actuelle=0.0;
374     RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
375     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
376     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
377     Mu_theta,Sigma_theta,Type_distribution_theta,
378     Mu_phi,Sigma_phi,Type_distribution_phi,
379     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
380     vector_epaisseur,
381     Porosite);
382 couturad 919 }
383 couturad 951 if(vector_epaisseur!=NULL) delete vector_epaisseur;
384     }
385     else if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT_GENERATEUR::TYPE_GENERATEUR::DCR)
386     {
387 couturad 952 #ifdef PROJECT_CHRONO
388 couturad 951 std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
389     MSTRUCT_GENERATEUR_DCR *DCR;
390     if(generateur==NULL)
391     {
392     DCR = new MSTRUCT_GENERATEUR_DCR(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
393     generateur=DCR;
394     DCR->active_affichage(fonc_affiche);
395     }
396     double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
397     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
398     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
399     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
400     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
401     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
402     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
403     Boite3D_distribution_Ymin,
404     Boite3D_distribution_Zmin,
405     Boite3D_distribution_Xmax,
406     Boite3D_distribution_Ymax,
407     Boite3D_distribution_Zmax);
408     DCR->change_boite3d_distribution(Boite3D_distribution);
409     double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
410     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
411     double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
412     DCR->change_nb_pas_grille(Nb_pas_X);
413     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
414     DCR->change_distance_inter_volume_min(Distance_min_inter_volume);
415     double Volume_min = param->get_valeur((char*)"Volume_min");
416     DCR->change_volume_min(Volume_min);
417     double Aire_min = param->get_valeur((char*)"Aire_min");
418     DCR->change_aire_min(Aire_min);
419     double Longueur_min = param->get_valeur((char*)"Longueur_min");
420     DCR->change_longueur_min(Longueur_min);
421     double Angle_min = param->get_valeur((char*)"Angle_min");
422     DCR->change_angle_min(Angle_min);
423 couturad 966 long Nb_iteration_max = (long)param->get_valeur((char*)"Nb_iteration_max");
424 couturad 951 bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
425     DCR->change_intersection_bords_ves(Avec_intersections);
426     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
427     int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
428     double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
429     double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
430     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
431     std::string multicouche = param->get_nom((char*)"Multicouche");
432 couturad 919
433 couturad 960 bool Avec_interface_graphique = (bool)param->get_valeur((char*)"Avec_interface_graphique");
434     double Facteur_reduction_vitesse = param->get_valeur((char*)"Facteur_reduction_vitesse");
435     double Friction = param->get_valeur((char*)"Friction");
436     double Pas_temps_sim = param->get_valeur((char*)"Pas_temps_sim");
437     double Temps_max_sim = param->get_valeur((char*)"Temps_max_sim");
438     double Eps_vitesse = param->get_valeur((char*)"Eps_vitesse");
439     DCR->active_interface_graphique(Avec_interface_graphique);
440     DCR->change_facteur_reduction_vitesse(Facteur_reduction_vitesse);
441     DCR->change_eps_vitesse(Eps_vitesse);
442     DCR->change_friction(Friction);
443     DCR->change_pas_temps(Pas_temps_sim);
444     DCR->change_temps_max_sim(Temps_max_sim);
445 couturad 966 bool Avec_post_RSA = (bool)param->get_valeur((char*)"Avec_post_RSA");
446 couturad 951
447     PARS_ARGUMENT parse_param[100];
448     PARSE parse;
449     parse.decode(multicouche.c_str(),"@,(&)",parse_param);
450     std::vector<double> *vector_epaisseur=NULL;
451     int nb_couche = atoi(parse_param[0].argument[0].c_str());
452     if(nb_couche>0)
453     {
454     vector_epaisseur=new std::vector<double>;
455     for(int i=0;i<nb_couche;i++)
456     {
457     double epaisseur=atof(parse_param[1].argument[i].c_str());
458     vector_epaisseur->push_back(epaisseur);
459     }
460     }
461 couturad 966 if(Type_inclusion==MSTRUCT_GENERATEUR::TYPE_INCLUSION::SPHERE)
462 couturad 951 {
463 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
464     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
465     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
466     DCR->ajouter_spheres(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique);
467     }
468     else if(Type_inclusion==MSTRUCT_GENERATEUR::TYPE_INCLUSION::CYLINDRE)
469     {
470     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
471     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
472     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
473     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
474     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
475     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
476     double Mu_theta = param->get_valeur((char*)"Mu_theta");
477     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
478     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
479     double Mu_phi = param->get_valeur((char*)"Mu_phi");
480     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
481     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
482     DCR->ajouter_cylindres(Nom_groupe_inclusion,
483     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
484     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
485     Mu_theta,Sigma_theta,Type_distribution_theta,
486     Mu_phi,Sigma_phi,Type_distribution_phi,
487     Fraction_volumique_cible,Eps_fraction_volumique);
488     }
489     if(DCR->lancer_simulation()==FAIL)
490 couturad 961 {
491     if(vector_epaisseur!=NULL) delete vector_epaisseur;
492     delete generateur;
493     return FAIL;
494 couturad 966 }
495     DCR->generer_geometrie();
496     if(Avec_post_RSA)
497     {
498     MSTRUCT_GENERATEUR_RSA *RSA = new MSTRUCT_GENERATEUR_RSA(*generateur);
499     RSA->change_nb_iteration_max(Nb_iteration_max);
500     if(Type_inclusion==MSTRUCT_GENERATEUR_RSA::TYPE_INCLUSION::SPHERE)
501     {
502     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
503     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
504     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
505     double fraction_volumique_actuelle=generateur->get_fraction_volumique_groupe_forme(Nom_groupe_inclusion);
506     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);
507 couturad 951 }
508     else if(Type_inclusion==MSTRUCT_GENERATEUR_RSA::TYPE_INCLUSION::CYLINDRE)
509     {
510 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
511     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
512     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
513     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
514     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
515     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
516     double Mu_theta = param->get_valeur((char*)"Mu_theta");
517     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
518     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
519     double Mu_phi = param->get_valeur((char*)"Mu_phi");
520     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
521     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
522     double fraction_volumique_actuelle=generateur->get_fraction_volumique_groupe_forme(Nom_groupe_inclusion);
523     RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
524     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
525     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
526     Mu_theta,Sigma_theta,Type_distribution_theta,
527     Mu_phi,Sigma_phi,Type_distribution_phi,
528     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
529     vector_epaisseur,
530     Porosite);
531     }
532     delete generateur;
533     generateur=RSA;
534     }
535     if(vector_epaisseur!=NULL) delete vector_epaisseur;
536 couturad 952 #else
537     std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl;
538 couturad 953 #endif
539 couturad 919 }
540     }
541     ot_cpu.ajouter_etape((char*)"generation_geometrie");
542 couturad 926 double temps_generation_geometrie;
543     ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie);
544     change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie);
545 couturad 919 generateur->construire(this);
546     delete generateur;
547     return OK;
548     }
549    
550 couturad 926 int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau)
551 couturad 919 {
552     OT_CPU ot_cpu;
553     ot_cpu.initialise();
554     std::vector<OT_PARAMETRES*>::iterator it;
555     for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++)
556     {
557     OT_PARAMETRES* param = *it;
558     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
559     double Mu_E = param->get_valeur((char*)"Mu_E");
560     double Sigma_E = param->get_valeur((char*)"Sigma_E");
561     double Mu_nu = param->get_valeur((char*)"Mu_nu");
562     double Sigma_nu = param->get_valeur((char*)"Sigma_nu");
563 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
564     std::map<long,MG_CG_FORME*>::iterator it_forme;
565     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))
566 couturad 919 {
567     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
568     {
569     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
570     if(Sigma_E==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Mu_E);
571     else
572     {
573     std::random_device seed;
574     std::mt19937_64 generateur(seed());
575     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
576     double Em = distribution(generateur);
577     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Em);
578     }
579     if(Sigma_nu==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",Mu_nu);
580     else
581     {
582     std::random_device seed;
583     std::mt19937_64 generateur(seed());
584     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
585     double nu = distribution(generateur);
586     forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu);
587     }
588     }
589     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
590     {
591     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
592     std::map<long,MG_VOLUME*>::iterator it_volume;
593     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))
594     {
595     if(Sigma_E==0.0) volume->ajouter_ccf((char*)"Em",Mu_E);
596     else
597     {
598     std::random_device seed;
599     std::mt19937_64 generateur(seed());
600     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
601     double Em = distribution(generateur);
602     volume->ajouter_ccf((char*)"Em",Em);
603     }
604     if(Sigma_nu==0.0) volume->ajouter_ccf((char*)"nu",Mu_nu);
605     else
606     {
607     std::random_device seed;
608     std::mt19937_64 generateur(seed());
609     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
610     double nu = distribution(generateur);
611     volume->ajouter_ccf((char*)"nu",nu);
612     }
613     }
614     }
615     }
616     }
617     ot_cpu.ajouter_etape((char*)"generation_materiau");
618 couturad 926 double temps_generation_materiau;
619     ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau);
620     change_temps_materiau(get_temps_materiau()+temps_generation_materiau);
621 couturad 919 return OK;
622     }
623    
624 couturad 926 int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param)
625 couturad 919 {
626     double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal");
627 couturad 937 double Ecart_nodal_face_particule = param->get_valeur((char*)"Ecart_nodal_face_particule");
628 couturad 919 double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage");
629     double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction");
630     std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution");
631     std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte");
632     std::string Nom_carte = param->get_nom((char*)"Nom_carte");
633     double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min");
634     double Nb_pas = param->get_valeur((char*)"Nb_pas");
635     double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation");
636     MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE;
637 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice");
638     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume();
639 couturad 919 OT_CPU ot_cpu;
640     ot_cpu.initialise();
641     FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte,
642     m_mg_geometrie,
643     Ecart_nodal,
644 couturad 937 Ecart_nodal_face_particule,
645 couturad 919 Fechantillonnage,
646     Nb_cellule_direction,
647     (char*)Nom_fem_solution.c_str(),
648     tpl_map_volume_matrice,
649     Nb_couche_min,
650     Nb_pas,
651     Facteur_augmentation);
652 couturad 926
653    
654 couturad 933 carte->active_affichage(fonc_affiche);
655 couturad 926 carte->construit();
656 couturad 919 ot_cpu.ajouter_etape((char*)"generation_carte");
657 couturad 926 double temps_generation_carte;
658     ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte);
659     change_temps_carte(get_temps_carte()+temps_generation_carte);
660     mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str());
661 couturad 919 carte->enregistrer((char*)Nom_carte.c_str());
662 couturad 964 char message[1000];
663     std::sprintf(message,"Fichier CARTE de sortie : %s",Nom_carte.c_str());
664     affiche(message);
665 couturad 926 m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str());
666 couturad 919 return OK;
667     }
668    
669 couturad 926 int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte)
670 couturad 919 {
671     OT_CPU ot_cpu;
672     ot_cpu.initialise();
673     int Niveau = (int)param->get_valeur((char*)"Niveau");
674     int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d");
675     int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d");
676     double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique");
677     int Analyse = (int)param->get_valeur((char*)"Analyse");
678     affiche((char*)"Maillage du VER :");
679     m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie);
680     m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage);
681 couturad 951 change_mg_maillage(m_mg_maillage);
682     affiche((char*)" Maillage 3D_couche :");
683     MAILLEUR3D_COUCHE m3d_couche(m_mg_maillage,m_mg_geometrie,carte);
684     m3d_couche.active_affichage(fonc_affiche);
685     LISTE_MG_VOLUME::iterator it_volume;
686     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
687 couturad 919 {
688 couturad 951 if(volume->est_mince())
689     {
690     char message[1000];
691     sprintf(message," -> Maillage du volume id %li",volume->get_id());
692     affiche(message);
693 couturad 966 if(m3d_couche.maille(volume)==FAIL) return FAIL;
694 couturad 951 }
695 couturad 919 }
696 couturad 951 if(Niveau>=0)
697 couturad 919 {
698 couturad 951 MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie);
699     affiche((char*)" Maillage 0D :");
700     LISTE_MG_SOMMET::iterator it_sommet;
701     for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet))
702     {
703     if(sommet->get_lien_maillage()->get_nb()>0) continue;
704     char message[1000];
705     sprintf(message," -> Maillage du sommet id %li",sommet->get_id());
706     affiche(message);
707 couturad 966 if(m0d.maille(sommet)==FAIL) return FAIL;
708 couturad 951 }
709 couturad 919 }
710 couturad 951 if(Niveau>=1)
711 couturad 919 {
712 couturad 951 MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte);
713     affiche((char*)" Maillage 1D :");
714     m1d.active_affichage(fonc_affiche);
715     LISTE_MG_ARETE::iterator it_arete;
716     for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete))
717     {
718     if(arete->get_lien_maillage()->get_nb()>0) continue;
719     char message[1000];
720     sprintf(message," -> Maillage de l'arete id %li",arete->get_id());
721     affiche(message);
722 couturad 966 if(m1d.maille(arete)==FAIL) return FAIL;
723 couturad 951 }
724 couturad 919 }
725 couturad 951 if(Niveau>=2)
726 couturad 919 {
727 couturad 951 MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte);
728     m2d.change_niveau_optimisation(Niveau_opt_2d);
729     m2d.change_priorite_metrique(Priorite_metrique);
730     affiche((char*)" Maillage 2D :");
731     m2d.active_affichage(fonc_affiche);
732     LISTE_MG_FACE::iterator it_face;
733     for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
734     {
735     if(face->get_lien_maillage()->get_nb()>0) continue;
736     char message[1000];
737     sprintf(message," -> Maillage de la face id %li",face->get_id());
738     affiche(message);
739 couturad 966 if(m2d.maille(face)==FAIL) return FAIL;
740 couturad 951 }
741 couturad 919 }
742 couturad 951 if(Niveau>=3)
743     {
744     MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false);
745     m3d.change_niveau_optimisation(Niveau_opt_3d);
746     m3d.change_priorite_metrique(Priorite_metrique);
747     affiche((char*)" Maillage 3D :");
748     m3d.active_affichage(fonc_affiche);
749     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
750     {
751     if(volume->get_lien_maillage()->get_nb()>0) continue;
752     if(volume->est_mince()) continue;
753     char message[1000];
754     sprintf(message," -> Maillage du volume id %li",volume->get_id());
755     affiche(message);
756 couturad 966 if(m3d.maille(volume)==FAIL) return FAIL;
757 couturad 951 }
758     }
759 couturad 919 ot_cpu.ajouter_etape((char*)"generation_maillage");
760 couturad 926 double temps_generation_maillage;
761     ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage);
762     change_temps_maillage(get_temps_maillage()+temps_generation_maillage);
763 couturad 919 return OK;
764     }
765    
766 couturad 926 int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param)
767 couturad 919 {
768     OT_CPU ot_cpu;
769     ot_cpu.initialise();
770     int Degre = (int)param->get_valeur((char*)"Degre");
771     int Analyse = (int)param->get_valeur((char*)"Analyse");
772     int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud");
773     MAILLEUR_FEM mailleurfem;
774     mailleurfem.active_affichage(fonc_affiche);
775 couturad 926 m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre);
776 couturad 919 m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage);
777 couturad 926 change_fem_maillage(m_fem_maillage);
778 couturad 966 if(Optimisation_num_noeud) {if(mailleurfem.maille(m_fem_maillage,1)==FAIL) return FAIL;}
779     else {if(mailleurfem.maille(m_fem_maillage,0)==FAIL) return FAIL;};
780 couturad 919 if(Analyse)
781     {
782     MAILLEUR_ANALYSE m3d(m_fem_maillage);
783     m3d.active_affichage(fonc_affiche);
784     // m3d.analyse();
785     }
786     ot_cpu.ajouter_etape((char*)"generation_fem_maillage");
787 couturad 926 double temps_generation_fem_maillage;
788     ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage);
789     change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage);
790 couturad 919 return OK;
791     }
792    
793 couturad 926 int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param)
794 couturad 919 {
795     OT_CPU ot_cpu;
796     ot_cpu.initialise();
797 couturad 926 BOITE_3D boite3D_ves = get_boite3d_ves();
798     double eps = get_precision();
799 couturad 919 TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
800     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
801     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
802     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
803     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
804     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
805     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
806     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
807     {
808     double xyzmin[3];
809     double xyzmax[3];
810     face->get_xyz_min_max(xyzmin,xyzmax,16);
811    
812 couturad 926 if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face);
813     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);
814     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);
815     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);
816     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);
817     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);
818 couturad 919 }
819     MG_SOMMET* sommet_origine;
820     MG_SOMMET* sommet_x1y0z0;
821     MG_SOMMET* sommet_x0y1z0;
822     MG_SOMMET* sommet_x0y0z1;
823     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
824     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
825     {
826     double xyz[3];
827     som->get_point()->evaluer(xyz);
828 couturad 926 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_origine=som;
829     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;
830     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;
831     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;
832 couturad 919 }
833     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
834     int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement");
835     int Type_CL = (int)param->get_valeur((char*)"Type_CL");
836     double Valeur_CL = param->get_valeur((char*)"Valeur_CL");
837     if(Type_etude==TYPE_ETUDE::MECANIQUE)
838     {
839     if(Type_Chargement==TYPE_CHARGEMENT::SPHERIQUE)
840     {
841     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
842     {
843     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
844     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",Valeur_CL,true);
845     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
846     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",Valeur_CL,true);
847     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
848     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",Valeur_CL,true);
849     }
850     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
851     {
852     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
853     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Pz",Valeur_CL,false);
854     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
855     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Px",Valeur_CL,false);
856     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
857     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Py",Valeur_CL,false);
858     }
859     }
860     else if(Type_Chargement==TYPE_CHARGEMENT::DEVIATORIQUE)
861     {
862     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
863     {
864     char chr_valeur_cl[1000];
865     sprintf(chr_valeur_cl,"%lf",Valeur_CL);
866     std::string str_valeur_cl = chr_valeur_cl;
867     std::string formule_Dx = str_valeur_cl+ "*Y";
868     std::string formule_Dy = str_valeur_cl+ "*Z";
869     std::string formule_Dz = str_valeur_cl+ "*X";
870     std::vector<std::string> liste_variable_formule_Dx;
871     std::vector<std::string> liste_variable_formule_Dy;
872     std::vector<std::string> liste_variable_formule_Dz;
873     liste_variable_formule_Dx.push_back((std::string)"Y");
874     liste_variable_formule_Dy.push_back((std::string)"Z");
875     liste_variable_formule_Dz.push_back((std::string)"X");
876     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
877     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
878     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
879     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
880     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
881     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
882     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
883     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
884     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
885     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
886     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
887     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
888     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
889     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
890     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
891     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
892     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
893     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
894     }
895     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
896     {
897     sommet_origine->ajouter_ccf((char*)"Dt",0.0);
898     sommet_x1y0z0->ajouter_ccf((char*)"Dy",0.0);
899     sommet_x1y0z0->ajouter_ccf((char*)"Dz",0.0);
900     sommet_x0y1z0->ajouter_ccf((char*)"Dz",0.0);
901     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Px",-Valeur_CL,true);
902     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Py",-Valeur_CL,true);
903     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Px",Valeur_CL,true);
904     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Py",Valeur_CL,true);
905     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Px",-Valeur_CL,true);
906     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Pz",-Valeur_CL,true);
907     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Px",Valeur_CL,true);
908     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Pz",Valeur_CL,true);
909     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Py",-Valeur_CL,true);
910     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Pz",-Valeur_CL,true);
911     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Py",Valeur_CL,true);
912     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Pz",Valeur_CL,true);
913     }
914     }
915     }
916     ot_cpu.ajouter_etape((char*)"generation_etude");
917 couturad 926 double temps_generation_etude;
918     ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude);
919     change_temps_etude(get_temps_etude()+temps_generation_etude);
920 couturad 919 return OK;
921     }
922    
923 couturad 926 int MSTRUCT_VES::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, double valeur,bool topo_sous_jacente)
924 couturad 919 {
925     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
926     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
927     {
928     face->ajouter_ccf(condition,valeur);
929     if(topo_sous_jacente==true)
930     {
931     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
932     face->get_topologie_sousjacente(&map_topo);
933     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
934     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
935     {
936     topo->ajouter_ccf(condition,valeur);
937     }
938     }
939     }
940     }
941    
942 couturad 926 int MSTRUCT_VES::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, std::string formule,std::vector<std::string> &listvariable,bool topo_sous_jacente)
943 couturad 919 {
944     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
945     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
946     {
947     face->ajouter_ccf(condition,formule,listvariable);
948     if(topo_sous_jacente==true)
949     {
950     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
951     face->get_topologie_sousjacente(&map_topo);
952     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
953     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
954     {
955     topo->ajouter_ccf(condition,formule,listvariable);
956     }
957     }
958     }
959     }
960    
961 couturad 926 int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster)
962 couturad 919 {
963     std::string Nom_etude = param->get_nom((char*)"Nom_etude");
964     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
965     int Type_calcul = (int)param->get_valeur((char*)"Type_calcul");
966     std::string Code_resu = param->get_nom((char*)"Code_resu");
967     MGASTER mgaster;
968     mgaster.active_affichage(fonc_affiche);
969     OT_CPU ot_cpu;
970     ot_cpu.initialise();
971     mgaster.calcule(param_aster,m_fem_maillage,(char*)Nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str());
972     ot_cpu.ajouter_etape((char*)"calcul");
973 couturad 926 double temps_calcul;
974     ot_cpu.get_etape((char*)"calcul",temps_calcul);
975     change_temps_calcul(get_temps_calcul()+temps_calcul);
976 couturad 919 }
977    
978 couturad 926 int MSTRUCT_VES::generer_analyse(std::vector< OT_PARAMETRES* >& vector_params_analyse)
979 couturad 919 {
980 couturad 926 OT_CPU ot_cpu;
981     ot_cpu.initialise();
982     std::vector<OT_PARAMETRES*>::iterator it;
983     for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++)
984 couturad 919 {
985 couturad 926 OT_PARAMETRES* param = *it;
986     std::string Identifiant = param->get_nom((char*)"Identifiant");
987     if(get_analyse(Identifiant)!=NULL)
988     {
989     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
990     continue;
991     }
992     char ligne[1000];
993     sprintf(ligne,"-> %s",Identifiant.c_str());
994     affiche(ligne);
995     int Type_analyse = (int)param->get_valeur((char*)"Type_analyse");
996     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
997 couturad 930 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
998     long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
999     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1000 couturad 926 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1001     BOITE_3D *boite_3d_analyse=NULL;
1002     if(Boite_analyse)
1003     {
1004     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1005     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1006     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1007     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1008     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1009     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1010     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1011     }
1012     if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
1013     {
1014     long Num_solution = (long)param->get_valeur((char*)"Num_solution");
1015     FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution);
1016     int nb_champ = sol->get_nb_champ();
1017     double Largeur_colonne = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1018     MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(Identifiant,sol->get_id(),nb_champ,Largeur_colonne,Nom_groupe_forme,boite_3d_analyse);
1019 couturad 930 if(!Analyse_erosion)
1020     {
1021     analyse_champ->executer(this);
1022     ajouter_analyse(analyse_champ);
1023     }
1024     else
1025     {
1026     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_champ,Nb_couche,Epaisseur_couche);
1027     analyse_erosion->executer(this);
1028     ajouter_analyse(analyse_erosion);
1029     }
1030 couturad 926 }
1031     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
1032     {
1033     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(Identifiant,Nom_groupe_forme,boite_3d_analyse);
1034 couturad 930 if(!Analyse_erosion)
1035     {
1036     analyse_orientation->executer(this);
1037     ajouter_analyse(analyse_orientation);
1038     }
1039     else
1040     {
1041     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_orientation,Nb_couche,Epaisseur_couche);
1042     analyse_erosion->executer(this);
1043     ajouter_analyse(analyse_erosion);
1044     }
1045 couturad 926 }
1046 couturad 938 else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION_PONDEREE)
1047     {
1048     MSTRUCT_ANALYSE_ORIENTATION_PONDEREE* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION_PONDEREE(Identifiant,Nom_groupe_forme,boite_3d_analyse);
1049     if(!Analyse_erosion)
1050     {
1051     analyse_orientation->executer(this);
1052     ajouter_analyse(analyse_orientation);
1053     }
1054     else
1055     {
1056     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_orientation,Nb_couche,Epaisseur_couche);
1057     analyse_erosion->executer(this);
1058     ajouter_analyse(analyse_erosion);
1059     }
1060     }
1061 couturad 926 else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
1062     {
1063     double Largeur_colonne_distribution_nb_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_volume");
1064     double Largeur_colonne_distribution_nb_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_forme");
1065     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
1066     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
1067     double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme");
1068     MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(Identifiant,
1069     Largeur_colonne_distribution_nb_volume,
1070     Largeur_colonne_distribution_nb_forme,
1071     Largeur_colonne_distribution_volume,
1072     Largeur_colonne_distribution_fraction_volumique,
1073     Largeur_colonne_distribution_volume_forme,
1074     Nom_groupe_forme);
1075 couturad 930 if(!Analyse_erosion)
1076     {
1077     analyse_cao->executer(this);
1078     ajouter_analyse(analyse_cao);
1079     }
1080     else
1081     {
1082     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_cao,Nb_couche,Epaisseur_couche);
1083     analyse_erosion->executer(this);
1084     ajouter_analyse(analyse_erosion);
1085     }
1086 couturad 926 }
1087     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
1088     {
1089     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
1090     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
1091     double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D");
1092     double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D");
1093     double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D");
1094     double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D");
1095     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
1096     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
1097    
1098     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(Identifiant,
1099     m_mg_maillage->get_id(),
1100     Largeur_colonne_distribution_qualite_2D,
1101     Largeur_colonne_distribution_nb_element_2D,
1102     Largeur_colonne_distribution_nb_element_3D,
1103     Largeur_colonne_distribution_taille_2D,
1104     Largeur_colonne_distribution_qualite_3D,
1105     Largeur_colonne_distribution_taille_3D,
1106     Largeur_colonne_distribution_volume,
1107     Largeur_colonne_distribution_fraction_volumique,
1108     Nom_groupe_forme);
1109 couturad 930 if(!Analyse_erosion)
1110     {
1111     analyse_mg_maillage->executer(this);
1112     ajouter_analyse(analyse_mg_maillage);
1113     }
1114     else
1115     {
1116     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_mg_maillage,Nb_couche,Epaisseur_couche);
1117     analyse_erosion->executer(this);
1118     ajouter_analyse(analyse_erosion);
1119     }
1120 couturad 926 }
1121     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
1122     {
1123     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
1124     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
1125     double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min");
1126     double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max");
1127     double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min");
1128     double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max");
1129     double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D");
1130     double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D");
1131     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
1132     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
1133     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(Identifiant,
1134     m_fem_maillage->get_id(),
1135     Largeur_colonne_distribution_nb_element_2D,
1136     Largeur_colonne_distribution_nb_element_3D,
1137     Largeur_colonne_distribution_jacobien_2D_min,
1138     Largeur_colonne_distribution_jacobien_2D_max,
1139     Largeur_colonne_distribution_jacobien_3D_min,
1140     Largeur_colonne_distribution_jacobien_3D_max,
1141     Largeur_colonne_distribution_distortion_2D,
1142     Largeur_colonne_distribution_distortion_3D,
1143     Largeur_colonne_distribution_volume,
1144     Largeur_colonne_distribution_fraction_volumique,
1145     Nom_groupe_forme,
1146     boite_3d_analyse);
1147 couturad 930 if(!Analyse_erosion)
1148     {
1149     analyse_maillage_fem->executer(this);
1150     ajouter_analyse(analyse_maillage_fem);
1151     }
1152     else
1153     {
1154     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_maillage_fem,Nb_couche,Epaisseur_couche);
1155     analyse_erosion->executer(this);
1156     ajouter_analyse(analyse_erosion);
1157     }
1158 couturad 926 }
1159     if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1160 couturad 919 }
1161 couturad 926 ot_cpu.ajouter_etape((char*)"analyse");
1162     double temps_analyse;
1163     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1164     change_temps_analyse(get_temps_analyse()+temps_analyse);
1165 couturad 919 }
1166    
1167 couturad 933 int MSTRUCT_VES::exporter_maillage_abaqus(void)
1168     {
1169     std::ofstream f;
1170     std::string file="noeuds";
1171 couturad 959 f.open(file.c_str(),std::ios::out);
1172 couturad 933 f.precision(16);
1173     f.setf(std::ios::showpoint);
1174     f << "*NODE"<< std::endl;
1175     LISTE_FEM_NOEUD::iterator it;
1176     long index=1;
1177     for (FEM_NOEUD* noeud=m_fem_maillage->get_premier_noeud(it);noeud;noeud=m_fem_maillage->get_suivant_noeud(it))
1178     {
1179     noeud->change_numero(index);
1180     double *coord=noeud->get_coord();
1181     f << noeud->get_numero() << ", " << coord[0] << ", " << coord[1] << ", " << coord[2] << std::endl;
1182     index++;
1183     }
1184     f.close();
1185     file="elements";
1186 couturad 959 f.open(file.c_str(),std::ios::out);
1187 couturad 933 f.precision(16);
1188     f.setf(std::ios::showpoint);
1189     index=1;
1190     LISTE_FEM_ELEMENT3::iterator ittele3;
1191     bool tetralin=false;
1192     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1193     {
1194     if(ele3->get_type_entite()==IDFEM_TETRA4)
1195     {
1196     if(tetralin==false)
1197     {
1198     tetralin=true;
1199     f << "*ELEMENT,TYPE=C3D4,ELSET=tetralin"<< std::endl;
1200     }
1201     f << index << ", "
1202     << ele3->get_fem_noeud(0)->get_numero() << ", "
1203     << ele3->get_fem_noeud(1)->get_numero() << ", "
1204     << ele3->get_fem_noeud(2)->get_numero() << ", "
1205     << ele3->get_fem_noeud(3)->get_numero() << std::endl;
1206     ele3->change_numero(index);
1207     index++;
1208     }
1209     }
1210     bool pentalin=false;
1211     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1212     {
1213     if(ele3->get_type_entite()==IDFEM_PENTA6)
1214     {
1215     if(pentalin==false)
1216     {
1217     pentalin=true;
1218     f << "*ELEMENT,TYPE=C3D6,ELSET=pentalin"<< std::endl;
1219     }
1220     f << index << ", "
1221     << ele3->get_fem_noeud(0)->get_numero() << ", "
1222     << ele3->get_fem_noeud(1)->get_numero() << ", "
1223     << ele3->get_fem_noeud(2)->get_numero() << ", "
1224     << ele3->get_fem_noeud(3)->get_numero() << ", "
1225     << ele3->get_fem_noeud(4)->get_numero() << ", "
1226     << ele3->get_fem_noeud(5)->get_numero() << std::endl;
1227     ele3->change_numero(index);
1228     index++;
1229     }
1230     }
1231     bool tetraquad=false;
1232     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1233     {
1234     if(ele3->get_type_entite()==IDFEM_TETRA10)
1235     {
1236     if(tetraquad==false)
1237     {
1238     tetraquad=true;
1239     f << "*ELEMENT,TYPE=C3D10,ELSET=tetraquad"<< std::endl;
1240     }
1241     f << index << ", "
1242     << ele3->get_fem_noeud(0)->get_numero() << ", "
1243     << ele3->get_fem_noeud(2)->get_numero() << ", "
1244     << ele3->get_fem_noeud(4)->get_numero() << ", "
1245     << ele3->get_fem_noeud(9)->get_numero() << ", "
1246     << ele3->get_fem_noeud(1)->get_numero() << ", "
1247     << ele3->get_fem_noeud(3)->get_numero() << ", "
1248     << ele3->get_fem_noeud(5)->get_numero() << ", "
1249     << ele3->get_fem_noeud(6)->get_numero() << ", "
1250     << ele3->get_fem_noeud(7)->get_numero() << ", "
1251     << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1252     ele3->change_numero(index);
1253     index++;
1254     }
1255     }
1256     bool pentaquad=false;
1257     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1258     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1259     {
1260     if(ele3->get_type_entite()==IDFEM_PENTA15)
1261     {
1262     if(pentaquad==false)
1263     {
1264     pentaquad=true;
1265     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1266     }
1267     f << index << ", "
1268     << ele3->get_fem_noeud(0)->get_numero() << ", "
1269     << ele3->get_fem_noeud(2)->get_numero() << ", "
1270     << ele3->get_fem_noeud(4)->get_numero() << ", "
1271     << ele3->get_fem_noeud(9)->get_numero() << ", "
1272     << ele3->get_fem_noeud(11)->get_numero() << ", "
1273     << ele3->get_fem_noeud(13)->get_numero() << ", "
1274     << ele3->get_fem_noeud(1)->get_numero() << ", "
1275     << ele3->get_fem_noeud(3)->get_numero() << ", "
1276     << ele3->get_fem_noeud(5)->get_numero() << ", "
1277     << ele3->get_fem_noeud(10)->get_numero() << ", "
1278     << ele3->get_fem_noeud(12)->get_numero() << ", "
1279     << ele3->get_fem_noeud(14)->get_numero() << ", "
1280     << ele3->get_fem_noeud(6)->get_numero() << ", "
1281     << ele3->get_fem_noeud(7)->get_numero() << ", "
1282     << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1283     ele3->change_numero(index);
1284     index++;
1285     }
1286     }
1287     f.close();
1288     file="BC_nsets";
1289 couturad 959 f.open(file.c_str(),std::ios::out);
1290 couturad 933 f.precision(16);
1291     f.setf(std::ios::showpoint);
1292     BOITE_3D boite3D_ves = get_boite3d_ves();
1293     double eps = get_precision();
1294     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
1295     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
1296     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
1297     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
1298     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
1299     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
1300     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
1301     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
1302     {
1303     double xyzmin[3];
1304     double xyzmax[3];
1305     face->get_xyz_min_max(xyzmin,xyzmax,16);
1306    
1307     if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face);
1308     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);
1309     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);
1310     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);
1311     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);
1312     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);
1313     }
1314     MG_SOMMET* sommet_x0y0z0=NULL;
1315     MG_SOMMET* sommet_x1y0z0=NULL;
1316     MG_SOMMET* sommet_x0y1z0=NULL;
1317     MG_SOMMET* sommet_x1y1z0=NULL;
1318     MG_SOMMET* sommet_x0y0z1=NULL;
1319     MG_SOMMET* sommet_x1y0z1=NULL;
1320     MG_SOMMET* sommet_x0y1z1=NULL;
1321     MG_SOMMET* sommet_x1y1z1=NULL;
1322     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
1323     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
1324     {
1325     double xyz[3];
1326     som->get_point()->evaluer(xyz);
1327     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;
1328     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;
1329     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;
1330     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;
1331     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;
1332     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;
1333     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;
1334     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;
1335     }
1336     f << "*NSET,NSET=coin_x0y0z0" << std::endl;
1337     FEM_NOEUD* coin_x0y0z0 = (FEM_NOEUD*)(sommet_x0y0z0->get_lien_fem_maillage()->get(0));
1338     f << coin_x0y0z0->get_numero() << std::endl;
1339     f << "*NSET,NSET=coin_x1y0z0" << std::endl;
1340     FEM_NOEUD* coin_x1y0z0 = (FEM_NOEUD*)(sommet_x1y0z0->get_lien_fem_maillage()->get(0));
1341     f << coin_x1y0z0->get_numero() << std::endl;
1342     f << "*NSET,NSET=coin_x0y1z0" << std::endl;
1343     FEM_NOEUD* coin_x0y1z0 = (FEM_NOEUD*)(sommet_x0y1z0->get_lien_fem_maillage()->get(0));
1344     f << coin_x0y1z0->get_numero() << std::endl;
1345     f << "*NSET,NSET=coin_x1y1z0" << std::endl;
1346     FEM_NOEUD* coin_x1y1z0 = (FEM_NOEUD*)(sommet_x1y1z0->get_lien_fem_maillage()->get(0));
1347     f << coin_x1y1z0->get_numero() << std::endl;
1348     f << "*NSET,NSET=coin_x0y0z1" << std::endl;
1349     FEM_NOEUD* coin_x0y0z1 = (FEM_NOEUD*)(sommet_x0y0z1->get_lien_fem_maillage()->get(0));
1350     f << coin_x0y0z1->get_numero() << std::endl;
1351     f << "*NSET,NSET=coin_x1y0z1" << std::endl;
1352     FEM_NOEUD* coin_x1y0z1 = (FEM_NOEUD*)(sommet_x1y0z1->get_lien_fem_maillage()->get(0));
1353     f << coin_x1y0z1->get_numero() << std::endl;
1354     f << "*NSET,NSET=coin_x0y1z1" << std::endl;
1355     FEM_NOEUD* coin_x0y1z1 = (FEM_NOEUD*)(sommet_x0y1z1->get_lien_fem_maillage()->get(0));
1356     f << coin_x0y1z1->get_numero() << std::endl;
1357     f << "*NSET,NSET=coin_x1y1z1" << std::endl;
1358     FEM_NOEUD* coin_x1y1z1 = (FEM_NOEUD*)(sommet_x1y1z1->get_lien_fem_maillage()->get(0));
1359     f << coin_x1y1z1->get_numero() << std::endl;
1360     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
1361     f << "*NSET,NSET=xEQ0" << std::endl;
1362     for(MG_FACE* face=plan_yz_x0.get_premier(it_face_plan);face!=NULL;face=plan_yz_x0.get_suivant(it_face_plan))
1363     {
1364     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1365     long nb_ele=lst_ele->get_nb();
1366     for(long i=0;i<nb_ele;i++)
1367     {
1368     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1369     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1370     {
1371     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1372     }
1373     }
1374     }
1375     f << "*NSET,NSET=xEQ1" << std::endl;
1376     for(MG_FACE* face=plan_yz_x1.get_premier(it_face_plan);face!=NULL;face=plan_yz_x1.get_suivant(it_face_plan))
1377     {
1378     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1379     long nb_ele=lst_ele->get_nb();
1380     for(long i=0;i<nb_ele;i++)
1381     {
1382     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1383     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1384     {
1385     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1386     }
1387     }
1388     }
1389     f << "*NSET,NSET=yEQ0" << std::endl;
1390     for(MG_FACE* face=plan_xz_y0.get_premier(it_face_plan);face!=NULL;face=plan_xz_y0.get_suivant(it_face_plan))
1391     {
1392     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1393     long nb_ele=lst_ele->get_nb();
1394     for(long i=0;i<nb_ele;i++)
1395     {
1396     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1397     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1398     {
1399     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1400     }
1401     }
1402     }
1403     f << "*NSET,NSET=yEQ1" << std::endl;
1404     for(MG_FACE* face=plan_xz_y1.get_premier(it_face_plan);face!=NULL;face=plan_xz_y1.get_suivant(it_face_plan))
1405     {
1406     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1407     long nb_ele=lst_ele->get_nb();
1408     for(long i=0;i<nb_ele;i++)
1409     {
1410     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1411     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1412     {
1413     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1414     }
1415     }
1416     }
1417     f << "*NSET,NSET=zEQ0" << std::endl;
1418     for(MG_FACE* face=plan_xy_z0.get_premier(it_face_plan);face!=NULL;face=plan_xy_z0.get_suivant(it_face_plan))
1419     {
1420     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1421     long nb_ele=lst_ele->get_nb();
1422     for(long i=0;i<nb_ele;i++)
1423     {
1424     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1425     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1426     {
1427     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1428     }
1429     }
1430     }
1431     f << "*NSET,NSET=zEQ1" << std::endl;
1432     for(MG_FACE* face=plan_xy_z1.get_premier(it_face_plan);face!=NULL;face=plan_xy_z1.get_suivant(it_face_plan))
1433     {
1434     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1435     long nb_ele=lst_ele->get_nb();
1436     for(long i=0;i<nb_ele;i++)
1437     {
1438     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1439     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1440     {
1441     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1442     }
1443     }
1444     }
1445     f.close();
1446     file="groupes_elements";
1447 couturad 959 f.open(file.c_str(),std::ios::out);
1448 couturad 933 f.precision(16);
1449     f.setf(std::ios::showpoint);
1450     std::map<long,MG_CG_GROUPE_FORME*>::iterator it_groupe_forme;
1451     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))
1452     {
1453     f << "*ELSET,ELSET=" << groupe_forme->get_nom() << std::endl;
1454     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume = groupe_forme->get_tpl_map_volume();
1455     TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_volume;
1456     for(MG_VOLUME* volume=tpl_map_volume.get_premier(it_volume);volume!=NULL;volume=tpl_map_volume.get_suivant(it_volume))
1457     {
1458     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1459     long nb_ele=lst_ele->get_nb();
1460     for(long i=0;i<nb_ele;i++)
1461     {
1462     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1463     f << ele3->get_numero() << std::endl;
1464     }
1465     }
1466     }
1467 couturad 937
1468     MG_CG_GROUPE_FORME* groupe_forme_particule=m_mgcg_modele->get_mgcg_groupe_forme((char*)"Sphere");
1469     if(groupe_forme_particule!=NULL)
1470     {
1471     file="particules";
1472 couturad 959 f.open(file.c_str(),std::ios::out);
1473 couturad 937 f.precision(16);
1474     f.setf(std::ios::showpoint);
1475     std::ofstream f2;
1476     f2.open((char*)"infos_particules");
1477     f2.precision(16);
1478     f2.setf(std::ios::showpoint);
1479     f2 << "# centre_x centre_y centre_z rayon position_relative" << std::endl;
1480     std::ofstream f_bord;
1481     f_bord.open((char*)"particules_bord");
1482     f_bord.precision(16);
1483     f_bord.setf(std::ios::showpoint);
1484     std::ofstream f_interieur;
1485     f_interieur.open((char*)"particules_interieur");
1486     f_interieur.precision(16);
1487     f_interieur.setf(std::ios::showpoint);
1488     long p=1;
1489     std::map<long,MG_CG_FORME*>::iterator it_forme;
1490     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))
1491     {
1492     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
1493     {
1494     f << "*ELSET,ELSET=P_" << p << std::endl;
1495     MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
1496     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
1497     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
1498     std::vector<double> vct_centre = centre->get_vct_valeur();
1499     f2 << p << " "
1500     << vct_centre.at(0) << " "
1501     << vct_centre.at(1) << " "
1502     << vct_centre.at(2) << " "
1503     << rayon->get_valeur() << " "
1504     << pos_rel->get_valeur() << std::endl;
1505     bool au_bord;
1506     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
1507     else au_bord=false;
1508     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
1509     MG_VOLUME* volume = forme_volume->get_mg_volume();
1510     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1511     long nb_ele=lst_ele->get_nb();
1512     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
1513     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
1514     for(long i=0;i<nb_ele;i++)
1515     {
1516     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1517     f << ele3->get_numero() << std::endl;
1518     if(au_bord)f_bord << ele3->get_numero() << std::endl;
1519     else f_interieur << ele3->get_numero() << std::endl;
1520     }
1521     p++;
1522     }
1523     else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
1524     {
1525     f << "*ELSET,ELSET=P_" << p << std::endl;
1526     MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
1527     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
1528     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
1529     std::vector<double> vct_centre = centre->get_vct_valeur();
1530     f2 << p << " "
1531     << vct_centre.at(0) << " "
1532     << vct_centre.at(1) << " "
1533     << vct_centre.at(2) << " "
1534     << rayon->get_valeur() << " "
1535     << pos_rel->get_valeur() << std::endl;
1536     bool au_bord;
1537     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
1538     else au_bord=false;
1539     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
1540     std::map<long,MG_VOLUME*>::iterator it_volume;
1541     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))
1542     {
1543     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
1544     long nb_ele=lst_ele->get_nb();
1545     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
1546     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
1547     for(long i=0;i<nb_ele;i++)
1548     {
1549     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
1550     f << ele3->get_numero() << std::endl;
1551     if(au_bord)f_bord << ele3->get_numero() << std::endl;
1552     else f_interieur << ele3->get_numero() << std::endl;
1553     }
1554     }
1555     p++;
1556     }
1557     }
1558     f_bord.close();
1559     f_interieur.close();
1560     f2.close();
1561     f.close();
1562     }
1563 couturad 933 }
1564 couturad 926
1565 couturad 933
1566 couturad 926 int MSTRUCT_VES::enregistrer(char* fichier_ves)
1567 couturad 919 {
1568 couturad 926 m_ves_file->enregistrer(fichier_ves);
1569 couturad 919 }
1570    
1571 couturad 926 int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic)
1572 couturad 919 {
1573 couturad 926 m_ves_file->change_nom_fichier_magic(fichier_magic);
1574     m_ves_file->enregistrer(fichier_ves);
1575     m_mg_gestionnaire->enregistrer(fichier_magic);
1576 couturad 919 }
1577    
1578 couturad 951 void MSTRUCT_VES::active_affichage(fonction_affiche* fonc)
1579 couturad 919 {
1580     fonc_affiche = fonc;
1581     affichageactif = 1;
1582     }
1583    
1584 couturad 926 void MSTRUCT_VES::affiche(char* message)
1585 couturad 919 {
1586     if(affichageactif==1) fonc_affiche(message);
1587     }
1588    
1589    
1590    
1591    
1592