ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 933
Committed: Wed May 23 18:48:54 2018 UTC (6 years, 11 months ago) by couturad
File size: 54319 byte(s)
Log Message:
MICROSTRUCTURE: 
Ajout d'un exportateur de maillage au format Abaqus
Mise a jour des fonctionnalites

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