ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 926
Committed: Tue May 1 20:38:42 2018 UTC (7 years ago) by couturad
File size: 39325 byte(s)
Log Message:
Ajout de nouvelles fonctionnalités de representation et d'analyse des VES
*Modification du CMakeLists.txt de microstructure

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 919 using namespace MICROSTRUCTURE;
29 couturad 926 MSTRUCT_VES::MSTRUCT_VES(void)
30 couturad 919 {
31     m_mg_gestionnaire=new MG_GESTIONNAIRE;
32     m_mg_geometrie=NULL;
33     m_mgcg_modele=NULL;
34 couturad 926 m_mgcg_assemblage=NULL;
35 couturad 919 m_mg_maillage=NULL;
36     m_fem_maillage=NULL;
37 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
38     change_boite_3D_ves(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
39     change_precision(1.0e-06);
40     change_temps_geometrie(0.0);
41     change_temps_carte(0.0);
42     change_temps_maillage(0.0);
43     change_temps_fem_maillage(0.0);
44     change_temps_etude(0.0);
45     change_temps_calcul(0.0);
46     change_temps_analyse(0.0);
47 couturad 919 }
48    
49 couturad 926 MSTRUCT_VES::MSTRUCT_VES(char* fichier_ves)
50 couturad 919 {
51 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
52     m_ves_file->ouvrir(fichier_ves);
53     m_mg_gestionnaire = new MG_FILE(m_ves_file->get_nom_fichier_magic());
54     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());
55     else m_mgcg_modele=NULL;
56     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());
57     else m_mgcg_assemblage=NULL;
58     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());
59     else m_mg_geometrie = NULL;
60     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());
61     else m_mg_maillage = NULL;
62     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());
63     else m_fem_maillage = NULL;
64 couturad 919 }
65    
66 couturad 926 MSTRUCT_VES::~MSTRUCT_VES(void)
67 couturad 919 {
68     delete m_mg_gestionnaire;
69 couturad 926 delete m_ves_file;
70 couturad 919 }
71    
72 couturad 926 MG_GESTIONNAIRE* MSTRUCT_VES::get_mg_gestionnaire(void)
73 couturad 919 {
74     return m_mg_gestionnaire;
75     }
76    
77 couturad 926 void MSTRUCT_VES::change_mg_gestionnaire(MG_GESTIONNAIRE* gest)
78 couturad 919 {
79 couturad 926 m_mg_gestionnaire=gest;
80     }
81    
82     void MSTRUCT_VES::change_mg_geometrie(MG_GEOMETRIE* mg_geometrie)
83     {
84 couturad 919 m_mg_geometrie=mg_geometrie;
85 couturad 926 m_ves_file->change_id_mg_geometrie(m_mg_geometrie->get_id());
86 couturad 919 }
87    
88 couturad 926 MG_GEOMETRIE* MSTRUCT_VES::get_mg_geometrie(void)
89 couturad 919 {
90     return m_mg_geometrie;
91     }
92    
93 couturad 926 void MSTRUCT_VES::change_mgcg_assemblage(MG_CG_ASSEMBLAGE* mgcg_assemblage)
94 couturad 919 {
95     m_mgcg_assemblage=mgcg_assemblage;
96 couturad 926 m_ves_file->change_id_mgcg_assemblage(m_mgcg_assemblage->get_id());
97 couturad 919 }
98    
99 couturad 926 MG_CG_ASSEMBLAGE* MSTRUCT_VES::get_mgcg_assemblage(void)
100 couturad 919 {
101     return m_mgcg_assemblage;
102     }
103    
104 couturad 926 void MSTRUCT_VES::change_mgcg_modele(MG_CG_MODELE* mgcg_modele)
105 couturad 919 {
106     m_mgcg_modele=mgcg_modele;
107 couturad 926 m_ves_file->change_id_mgcg_modele(m_mgcg_modele->get_id());
108 couturad 919 }
109    
110 couturad 926 MG_CG_MODELE* MSTRUCT_VES::get_mgcg_modele(void)
111 couturad 919 {
112     return m_mgcg_modele;
113     }
114    
115 couturad 926 MG_MAILLAGE* MSTRUCT_VES::get_mg_maillage(void)
116 couturad 919 {
117     return m_mg_maillage;
118     }
119    
120 couturad 926 void MSTRUCT_VES::change_mg_maillage(MG_MAILLAGE* mg_maillage)
121 couturad 919 {
122     m_mg_maillage=mg_maillage;
123 couturad 926 m_ves_file->change_id_mg_maillage(m_mg_maillage->get_id());
124 couturad 919 }
125    
126 couturad 926 FEM_MAILLAGE* MSTRUCT_VES::get_fem_maillage(void)
127 couturad 919 {
128     return m_fem_maillage;
129     }
130    
131 couturad 926 void MSTRUCT_VES::change_fem_maillage(FEM_MAILLAGE* fem_maillage)
132 couturad 919 {
133     m_fem_maillage=fem_maillage;
134 couturad 926 m_ves_file->change_id_fem_maillage(m_fem_maillage->get_id());
135 couturad 919 }
136    
137 couturad 926 BOITE_3D MSTRUCT_VES::get_boite3d_ves(void)
138 couturad 919 {
139 couturad 926 return m_ves_file->get_boite_3D_ves();
140 couturad 919 }
141    
142 couturad 926 void MSTRUCT_VES::change_boite_3D_ves(BOITE_3D boite3D)
143 couturad 919 {
144 couturad 926 m_ves_file->change_boite_3D_ves(boite3D);
145 couturad 919 }
146    
147 couturad 926 double MSTRUCT_VES::get_precision(void)
148 couturad 919 {
149 couturad 926 return m_ves_file->get_precision();
150 couturad 919 }
151    
152 couturad 926 void MSTRUCT_VES::change_precision(double precision)
153 couturad 919 {
154 couturad 926 m_ves_file->change_precision(precision);
155 couturad 919 }
156    
157 couturad 926 double MSTRUCT_VES::get_temps_geometrie(void)
158 couturad 919 {
159 couturad 926 return m_ves_file->get_temps_geometrie();
160 couturad 919 }
161    
162 couturad 926 void MSTRUCT_VES::change_temps_geometrie(double temps)
163 couturad 919 {
164 couturad 926 m_ves_file->change_temps_geometrie(temps);
165 couturad 919 }
166    
167 couturad 926 double MSTRUCT_VES::get_temps_materiau(void)
168     {
169     return m_ves_file->get_temps_materiau();
170     }
171 couturad 919
172 couturad 926 void MSTRUCT_VES::change_temps_materiau(double temps)
173 couturad 919 {
174 couturad 926 m_ves_file->change_temps_materiau(temps);
175     }
176    
177     double MSTRUCT_VES::get_temps_carte(void)
178     {
179     return m_ves_file->get_temps_carte();
180     }
181    
182     void MSTRUCT_VES::change_temps_carte(double temps)
183     {
184     m_ves_file->change_temps_carte(temps);
185     }
186    
187     double MSTRUCT_VES::get_temps_maillage(void)
188     {
189     return m_ves_file->get_temps_maillage();
190     }
191    
192     void MSTRUCT_VES::change_temps_maillage(double temps)
193     {
194     m_ves_file->change_temps_maillage(temps);
195     }
196    
197     double MSTRUCT_VES::get_temps_fem_maillage(void)
198     {
199     return m_ves_file->get_temps_fem_maillage();
200     }
201    
202     void MSTRUCT_VES::change_temps_fem_maillage(double temps)
203     {
204     m_ves_file->change_temps_fem_maillage(temps);
205     }
206    
207     double MSTRUCT_VES::get_temps_etude(void)
208     {
209     return m_ves_file->get_temps_etude();
210     }
211    
212     void MSTRUCT_VES::change_temps_etude(double temps)
213     {
214     m_ves_file->change_temps_etude(temps);
215     }
216    
217     double MSTRUCT_VES::get_temps_calcul(void)
218     {
219     return m_ves_file->get_temps_calcul();
220     }
221    
222     void MSTRUCT_VES::change_temps_calcul(double temps)
223     {
224     m_ves_file->change_temps_calcul(temps);
225     }
226    
227     double MSTRUCT_VES::get_temps_analyse(void)
228     {
229     return m_ves_file->get_temps_analyse();
230     }
231    
232     void MSTRUCT_VES::change_temps_analyse(double temps)
233     {
234     m_ves_file->change_temps_analyse(temps);
235     }
236    
237     long int MSTRUCT_VES::get_nb_analyse(void)
238     {
239     return m_ves_file->get_nb_analyse();
240     }
241    
242     int MSTRUCT_VES::ajouter_analyse(MSTRUCT_ANALYSE* analyse_ves)
243     {
244     return m_ves_file->ajouter_analyse(analyse_ves);
245     }
246    
247     MSTRUCT_ANALYSE* MSTRUCT_VES::get_premiere_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
248     {
249     return m_ves_file->get_premiere_analyse(it);
250     }
251    
252     MSTRUCT_ANALYSE* MSTRUCT_VES::get_suivante_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
253     {
254     return m_ves_file->get_suivante_analyse(it);
255     }
256    
257     MSTRUCT_ANALYSE* MSTRUCT_VES::get_analyse(string identifiant)
258     {
259     return m_ves_file->get_analyse(identifiant);
260     }
261    
262     int MSTRUCT_VES::supprimer_analyse(string identifiant)
263     {
264     return m_ves_file->supprimer_analyse(identifiant);
265     }
266    
267     int MSTRUCT_VES::supprimer_tout_analyse(void)
268     {
269     return m_ves_file->supprimer_tout_analyse();
270     }
271    
272     int MSTRUCT_VES::generer_geometrie(std::vector< OT_PARAMETRES* >& vector_params_geometrie)
273     {
274 couturad 919 OT_CPU ot_cpu;
275     ot_cpu.initialise();
276     GENERATEUR* generateur=NULL;
277     std::vector<OT_PARAMETRES*>::iterator it;
278     for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++)
279     {
280     OT_PARAMETRES* param = *it;
281     if(((int)param->get_valeur((char*)"Type_generateur"))==GENERATEUR::TYPE_GENERATEUR::RSA)
282     {
283     GENERATEUR_RSA *RSA;
284     std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
285     double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
286     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
287     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
288     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
289     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
290     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
291     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
292     Boite3D_distribution_Ymin,
293     Boite3D_distribution_Zmin,
294     Boite3D_distribution_Xmax,
295     Boite3D_distribution_Ymax,
296     Boite3D_distribution_Zmax);
297     double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
298     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
299     double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
300     if(generateur==NULL)
301     {
302 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);
303 couturad 919 generateur=RSA;
304     }
305     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
306     int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
307     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
308     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
309     double Volume_min = param->get_valeur((char*)"Volume_min");
310     double Aire_min = param->get_valeur((char*)"Aire_min");
311     double Longueur_min = param->get_valeur((char*)"Longueur_min");
312     double Angle_min = param->get_valeur((char*)"Angle_min");
313     double Nb_volume_max = param->get_valeur((char*)"Nb_volume_max");
314     double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max");
315     double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
316     if(Type_inclusion==GENERATEUR_RSA::TYPE_INCLUSION::SPHERE)
317     {
318     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
319     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
320     RSA->tirrage_aleatoire_sphere(Nom_groupe_inclusion,
321     Mu_rayon,Sigma_rayon,
322     Fraction_volumique_cible,
323     Distance_min_inter_volume,
324     Volume_min,
325     Aire_min,
326     Longueur_min,
327     Angle_min,
328     Nb_volume_max,
329     Nb_iteration_max,
330     Porosite);
331     }
332     else if(Type_inclusion==GENERATEUR_RSA::TYPE_INCLUSION::CYLINDRE)
333     {
334     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
335     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
336     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
337     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
338     double Mu_axe_X = param->get_valeur((char*)"Mu_axe_X");
339     double Sigma_axe_X = param->get_valeur((char*)"Sigma_axe_X");
340     double Type_distribution_axe_X = param->get_valeur((char*)"Type_distribution_axe_X");
341     double Mu_axe_Y = param->get_valeur((char*)"Type_distribution_axe_X");
342     double Sigma_axe_Y = param->get_valeur((char*)"Sigma_axe_Y");
343     double Type_distribution_axe_Y = param->get_valeur((char*)"Type_distribution_axe_Y");
344     double Mu_axe_Z = param->get_valeur((char*)"Mu_axe_Z");
345     double Sigma_axe_Z = param->get_valeur((char*)"Sigma_axe_Z");
346     double Type_distribution_axe_Z = param->get_valeur((char*)"Type_distribution_axe_Z");
347     RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
348     Mu_rayon,Sigma_rayon,
349     Mu_longueur,Sigma_longueur,
350     Mu_axe_X,Sigma_axe_X,Type_distribution_axe_X,
351     Mu_axe_Y,Sigma_axe_Y,Type_distribution_axe_Y,
352     Mu_axe_Z,Sigma_axe_Z,Type_distribution_axe_Z,Fraction_volumique_cible,
353     Distance_min_inter_volume,
354     Volume_min,
355     Aire_min,
356     Longueur_min,
357     Angle_min,
358     Nb_volume_max,
359     Nb_iteration_max,
360     Porosite);
361     }
362    
363     }
364     }
365     ot_cpu.ajouter_etape((char*)"generation_geometrie");
366 couturad 926 double temps_generation_geometrie;
367     ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie);
368     change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie);
369 couturad 919 generateur->construire(this);
370     delete generateur;
371     return OK;
372     }
373    
374 couturad 926 int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau)
375 couturad 919 {
376     OT_CPU ot_cpu;
377     ot_cpu.initialise();
378     std::vector<OT_PARAMETRES*>::iterator it;
379     for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++)
380     {
381     OT_PARAMETRES* param = *it;
382     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
383     double Mu_E = param->get_valeur((char*)"Mu_E");
384     double Sigma_E = param->get_valeur((char*)"Sigma_E");
385     double Mu_nu = param->get_valeur((char*)"Mu_nu");
386     double Sigma_nu = param->get_valeur((char*)"Sigma_nu");
387 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
388     std::map<long,MG_CG_FORME*>::iterator it_forme;
389     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))
390 couturad 919 {
391     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
392     {
393     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
394     if(Sigma_E==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Mu_E);
395     else
396     {
397     std::random_device seed;
398     std::mt19937_64 generateur(seed());
399     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
400     double Em = distribution(generateur);
401     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Em);
402     }
403     if(Sigma_nu==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",Mu_nu);
404     else
405     {
406     std::random_device seed;
407     std::mt19937_64 generateur(seed());
408     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
409     double nu = distribution(generateur);
410     forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu);
411     }
412     }
413     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
414     {
415     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
416     std::map<long,MG_VOLUME*>::iterator it_volume;
417     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))
418     {
419     if(Sigma_E==0.0) volume->ajouter_ccf((char*)"Em",Mu_E);
420     else
421     {
422     std::random_device seed;
423     std::mt19937_64 generateur(seed());
424     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
425     double Em = distribution(generateur);
426     volume->ajouter_ccf((char*)"Em",Em);
427     }
428     if(Sigma_nu==0.0) volume->ajouter_ccf((char*)"nu",Mu_nu);
429     else
430     {
431     std::random_device seed;
432     std::mt19937_64 generateur(seed());
433     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
434     double nu = distribution(generateur);
435     volume->ajouter_ccf((char*)"nu",nu);
436     }
437     }
438     }
439     }
440     }
441     ot_cpu.ajouter_etape((char*)"generation_materiau");
442 couturad 926 double temps_generation_materiau;
443     ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau);
444     change_temps_materiau(get_temps_materiau()+temps_generation_materiau);
445 couturad 919 return OK;
446     }
447    
448 couturad 926 int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param)
449 couturad 919 {
450     double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal");
451     double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage");
452     double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction");
453     std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution");
454     std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte");
455     std::string Nom_carte = param->get_nom((char*)"Nom_carte");
456     double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min");
457     double Nb_pas = param->get_valeur((char*)"Nb_pas");
458     double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation");
459     MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE;
460 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice");
461     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume();
462 couturad 919 OT_CPU ot_cpu;
463     ot_cpu.initialise();
464     FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte,
465     m_mg_geometrie,
466     Ecart_nodal,
467     Fechantillonnage,
468     Nb_cellule_direction,
469     (char*)Nom_fem_solution.c_str(),
470     tpl_map_volume_matrice,
471     Nb_couche_min,
472     Nb_pas,
473     Facteur_augmentation);
474 couturad 926
475    
476     carte->construit();
477 couturad 919 ot_cpu.ajouter_etape((char*)"generation_carte");
478 couturad 926 double temps_generation_carte;
479     ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte);
480     change_temps_carte(get_temps_carte()+temps_generation_carte);
481     mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str());
482 couturad 919 carte->enregistrer((char*)Nom_carte.c_str());
483 couturad 926 m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str());
484 couturad 919 return OK;
485     }
486    
487 couturad 926 int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte)
488 couturad 919 {
489     OT_CPU ot_cpu;
490     ot_cpu.initialise();
491     int Niveau = (int)param->get_valeur((char*)"Niveau");
492     int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d");
493     int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d");
494     double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique");
495     int Analyse = (int)param->get_valeur((char*)"Analyse");
496     affiche((char*)"Maillage du VER :");
497     m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie);
498     m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage);
499 couturad 926 change_mg_maillage(m_mg_maillage);
500 couturad 919 MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie);
501     affiche((char*)" Maillage 0D :");
502     LISTE_MG_SOMMET::iterator it_sommet;
503     for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet))
504     {
505     char message[1000];
506     sprintf(message," -> Maillage du sommet id %li",sommet->get_id());
507     affiche(message);
508     m0d.maille(sommet);
509     }
510    
511     MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte);
512     affiche((char*)" Maillage 1D :");
513     m1d.active_affichage(fonc_affiche);
514     LISTE_MG_ARETE::iterator it_arete;
515     for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete))
516     {
517     char message[1000];
518     sprintf(message," -> Maillage de l'arete id %li",arete->get_id());
519     affiche(message);
520     m1d.maille(arete);
521     }
522     MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte);
523     m2d.change_niveau_optimisation(Niveau_opt_2d);
524     m2d.change_priorite_metrique(Priorite_metrique);
525     affiche((char*)" Maillage 2D :");
526     m2d.active_affichage(fonc_affiche);
527     LISTE_MG_FACE::iterator it_face;
528     for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
529     {
530     char message[1000];
531     sprintf(message," -> Maillage de la face id %li",face->get_id());
532     affiche(message);
533     m2d.maille(face);
534     }
535     MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false);
536     m3d.change_niveau_optimisation(Niveau_opt_2d);
537     m3d.change_priorite_metrique(Priorite_metrique);
538     affiche((char*)" Maillage 3D :");
539     m3d.active_affichage(fonc_affiche);
540     LISTE_MG_VOLUME::iterator it_volume;
541     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
542     {
543     char message[1000];
544     sprintf(message," -> Maillage du volume id %li",volume->get_id());
545     affiche(message);
546     m3d.maille(volume);
547     }
548     ot_cpu.ajouter_etape((char*)"generation_maillage");
549 couturad 926 double temps_generation_maillage;
550     ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage);
551     change_temps_maillage(get_temps_maillage()+temps_generation_maillage);
552 couturad 919 return OK;
553     }
554    
555 couturad 926 int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param)
556 couturad 919 {
557     OT_CPU ot_cpu;
558     ot_cpu.initialise();
559     int Degre = (int)param->get_valeur((char*)"Degre");
560     int Analyse = (int)param->get_valeur((char*)"Analyse");
561     int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud");
562     MAILLEUR_FEM mailleurfem;
563     mailleurfem.active_affichage(fonc_affiche);
564 couturad 926 m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre);
565 couturad 919 m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage);
566 couturad 926 change_fem_maillage(m_fem_maillage);
567 couturad 919 if(Optimisation_num_noeud) mailleurfem.maille(m_fem_maillage,1);
568     else mailleurfem.maille(m_fem_maillage,0);
569     if(Analyse)
570     {
571     MAILLEUR_ANALYSE m3d(m_fem_maillage);
572     m3d.active_affichage(fonc_affiche);
573     // m3d.analyse();
574     }
575     ot_cpu.ajouter_etape((char*)"generation_fem_maillage");
576 couturad 926 double temps_generation_fem_maillage;
577     ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage);
578     change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage);
579 couturad 919 return OK;
580     }
581    
582 couturad 926 int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param)
583 couturad 919 {
584     OT_CPU ot_cpu;
585     ot_cpu.initialise();
586 couturad 926 BOITE_3D boite3D_ves = get_boite3d_ves();
587     double eps = get_precision();
588 couturad 919 TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
589     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
590     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
591     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
592     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
593     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
594     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
595     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
596     {
597     double xyzmin[3];
598     double xyzmax[3];
599     face->get_xyz_min_max(xyzmin,xyzmax,16);
600    
601 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);
602     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);
603     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);
604     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);
605     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);
606     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);
607 couturad 919 }
608     MG_SOMMET* sommet_origine;
609     MG_SOMMET* sommet_x1y0z0;
610     MG_SOMMET* sommet_x0y1z0;
611     MG_SOMMET* sommet_x0y0z1;
612     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
613     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
614     {
615     double xyz[3];
616     som->get_point()->evaluer(xyz);
617 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;
618     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;
619     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;
620     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;
621 couturad 919 }
622     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
623     int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement");
624     int Type_CL = (int)param->get_valeur((char*)"Type_CL");
625     double Valeur_CL = param->get_valeur((char*)"Valeur_CL");
626     if(Type_etude==TYPE_ETUDE::MECANIQUE)
627     {
628     if(Type_Chargement==TYPE_CHARGEMENT::SPHERIQUE)
629     {
630     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
631     {
632     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
633     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",Valeur_CL,true);
634     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
635     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",Valeur_CL,true);
636     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
637     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",Valeur_CL,true);
638     }
639     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
640     {
641     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
642     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Pz",Valeur_CL,false);
643     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
644     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Px",Valeur_CL,false);
645     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
646     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Py",Valeur_CL,false);
647     }
648     }
649     else if(Type_Chargement==TYPE_CHARGEMENT::DEVIATORIQUE)
650     {
651     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
652     {
653     char chr_valeur_cl[1000];
654     sprintf(chr_valeur_cl,"%lf",Valeur_CL);
655     std::string str_valeur_cl = chr_valeur_cl;
656     std::string formule_Dx = str_valeur_cl+ "*Y";
657     std::string formule_Dy = str_valeur_cl+ "*Z";
658     std::string formule_Dz = str_valeur_cl+ "*X";
659     std::vector<std::string> liste_variable_formule_Dx;
660     std::vector<std::string> liste_variable_formule_Dy;
661     std::vector<std::string> liste_variable_formule_Dz;
662     liste_variable_formule_Dx.push_back((std::string)"Y");
663     liste_variable_formule_Dy.push_back((std::string)"Z");
664     liste_variable_formule_Dz.push_back((std::string)"X");
665     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
666     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
667     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
668     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
669     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
670     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
671     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
672     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
673     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
674     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
675     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
676     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
677     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
678     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
679     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
680     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
681     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
682     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
683     }
684     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
685     {
686     sommet_origine->ajouter_ccf((char*)"Dt",0.0);
687     sommet_x1y0z0->ajouter_ccf((char*)"Dy",0.0);
688     sommet_x1y0z0->ajouter_ccf((char*)"Dz",0.0);
689     sommet_x0y1z0->ajouter_ccf((char*)"Dz",0.0);
690     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Px",-Valeur_CL,true);
691     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Py",-Valeur_CL,true);
692     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Px",Valeur_CL,true);
693     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Py",Valeur_CL,true);
694     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Px",-Valeur_CL,true);
695     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Pz",-Valeur_CL,true);
696     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Px",Valeur_CL,true);
697     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Pz",Valeur_CL,true);
698     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Py",-Valeur_CL,true);
699     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Pz",-Valeur_CL,true);
700     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Py",Valeur_CL,true);
701     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Pz",Valeur_CL,true);
702     }
703     }
704     }
705     ot_cpu.ajouter_etape((char*)"generation_etude");
706 couturad 926 double temps_generation_etude;
707     ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude);
708     change_temps_etude(get_temps_etude()+temps_generation_etude);
709 couturad 919 return OK;
710     }
711    
712 couturad 926 int MSTRUCT_VES::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, double valeur,bool topo_sous_jacente)
713 couturad 919 {
714     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
715     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
716     {
717     face->ajouter_ccf(condition,valeur);
718     if(topo_sous_jacente==true)
719     {
720     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
721     face->get_topologie_sousjacente(&map_topo);
722     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
723     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
724     {
725     topo->ajouter_ccf(condition,valeur);
726     }
727     }
728     }
729     }
730    
731 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)
732 couturad 919 {
733     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
734     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
735     {
736     face->ajouter_ccf(condition,formule,listvariable);
737     if(topo_sous_jacente==true)
738     {
739     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
740     face->get_topologie_sousjacente(&map_topo);
741     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
742     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
743     {
744     topo->ajouter_ccf(condition,formule,listvariable);
745     }
746     }
747     }
748     }
749    
750 couturad 926 int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster)
751 couturad 919 {
752     std::string Nom_etude = param->get_nom((char*)"Nom_etude");
753     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
754     int Type_calcul = (int)param->get_valeur((char*)"Type_calcul");
755     std::string Code_resu = param->get_nom((char*)"Code_resu");
756     MGASTER mgaster;
757     mgaster.active_affichage(fonc_affiche);
758     OT_CPU ot_cpu;
759     ot_cpu.initialise();
760     mgaster.calcule(param_aster,m_fem_maillage,(char*)Nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str());
761     ot_cpu.ajouter_etape((char*)"calcul");
762 couturad 926 double temps_calcul;
763     ot_cpu.get_etape((char*)"calcul",temps_calcul);
764     change_temps_calcul(get_temps_calcul()+temps_calcul);
765 couturad 919 }
766    
767 couturad 926 int MSTRUCT_VES::generer_analyse(std::vector< OT_PARAMETRES* >& vector_params_analyse)
768 couturad 919 {
769 couturad 926 OT_CPU ot_cpu;
770     ot_cpu.initialise();
771     std::vector<OT_PARAMETRES*>::iterator it;
772     for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++)
773 couturad 919 {
774 couturad 926 OT_PARAMETRES* param = *it;
775     std::string Identifiant = param->get_nom((char*)"Identifiant");
776     if(get_analyse(Identifiant)!=NULL)
777     {
778     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
779     continue;
780     }
781     char ligne[1000];
782     sprintf(ligne,"-> %s",Identifiant.c_str());
783     affiche(ligne);
784     int Type_analyse = (int)param->get_valeur((char*)"Type_analyse");
785     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
786     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
787     BOITE_3D *boite_3d_analyse=NULL;
788     if(Boite_analyse)
789     {
790     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
791     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
792     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
793     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
794     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
795     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
796     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
797     }
798     if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
799     {
800     long Num_solution = (long)param->get_valeur((char*)"Num_solution");
801     FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution);
802     int nb_champ = sol->get_nb_champ();
803     double Largeur_colonne = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
804     MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(Identifiant,sol->get_id(),nb_champ,Largeur_colonne,Nom_groupe_forme,boite_3d_analyse);
805     analyse_champ->executer(this);
806     ajouter_analyse(analyse_champ);
807     }
808     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
809     {
810     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(Identifiant,Nom_groupe_forme,boite_3d_analyse);
811     analyse_orientation->executer(this);
812     ajouter_analyse(analyse_orientation);
813     }
814     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
815     {
816     double Largeur_colonne_distribution_nb_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_volume");
817     double Largeur_colonne_distribution_nb_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_forme");
818     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
819     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
820     double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme");
821     MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(Identifiant,
822     Largeur_colonne_distribution_nb_volume,
823     Largeur_colonne_distribution_nb_forme,
824     Largeur_colonne_distribution_volume,
825     Largeur_colonne_distribution_fraction_volumique,
826     Largeur_colonne_distribution_volume_forme,
827     Nom_groupe_forme);
828     analyse_cao->executer(this);
829     ajouter_analyse(analyse_cao);
830     }
831     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
832     {
833     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
834     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
835     double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D");
836     double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D");
837     double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D");
838     double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D");
839     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
840     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
841    
842     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(Identifiant,
843     m_mg_maillage->get_id(),
844     Largeur_colonne_distribution_qualite_2D,
845     Largeur_colonne_distribution_nb_element_2D,
846     Largeur_colonne_distribution_nb_element_3D,
847     Largeur_colonne_distribution_taille_2D,
848     Largeur_colonne_distribution_qualite_3D,
849     Largeur_colonne_distribution_taille_3D,
850     Largeur_colonne_distribution_volume,
851     Largeur_colonne_distribution_fraction_volumique,
852     Nom_groupe_forme);
853     analyse_mg_maillage->executer(this);
854     ajouter_analyse(analyse_mg_maillage);
855     }
856     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
857     {
858     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
859     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
860     double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min");
861     double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max");
862     double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min");
863     double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max");
864     double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D");
865     double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D");
866     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
867     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
868     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(Identifiant,
869     m_fem_maillage->get_id(),
870     Largeur_colonne_distribution_nb_element_2D,
871     Largeur_colonne_distribution_nb_element_3D,
872     Largeur_colonne_distribution_jacobien_2D_min,
873     Largeur_colonne_distribution_jacobien_2D_max,
874     Largeur_colonne_distribution_jacobien_3D_min,
875     Largeur_colonne_distribution_jacobien_3D_max,
876     Largeur_colonne_distribution_distortion_2D,
877     Largeur_colonne_distribution_distortion_3D,
878     Largeur_colonne_distribution_volume,
879     Largeur_colonne_distribution_fraction_volumique,
880     Nom_groupe_forme,
881     boite_3d_analyse);
882     analyse_maillage_fem->executer(this);
883     ajouter_analyse(analyse_maillage_fem);
884     }
885     if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
886 couturad 919 }
887 couturad 926 ot_cpu.ajouter_etape((char*)"analyse");
888     double temps_analyse;
889     ot_cpu.get_etape((char*)"analyse",temps_analyse);
890     change_temps_analyse(get_temps_analyse()+temps_analyse);
891 couturad 919 }
892    
893 couturad 926
894     int MSTRUCT_VES::enregistrer(char* fichier_ves)
895 couturad 919 {
896 couturad 926 m_ves_file->enregistrer(fichier_ves);
897 couturad 919 }
898    
899 couturad 926 int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic)
900 couturad 919 {
901 couturad 926 m_ves_file->change_nom_fichier_magic(fichier_magic);
902     m_ves_file->enregistrer(fichier_ves);
903     m_mg_gestionnaire->enregistrer(fichier_magic);
904 couturad 919 }
905    
906 couturad 926 void MSTRUCT_VES::active_affichage(MICROSTRUCTURE::fonction_affiche* fonc)
907 couturad 919 {
908     fonc_affiche = fonc;
909     affichageactif = 1;
910     }
911    
912 couturad 926 void MSTRUCT_VES::affiche(char* message)
913 couturad 919 {
914     if(affichageactif==1) fonc_affiche(message);
915     }
916    
917    
918    
919    
920