ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 929
Committed: Fri May 11 18:14:54 2018 UTC (7 years ago) by couturad
File size: 39206 byte(s)
Log Message:
Mise a jour des fonctionnalites 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 couturad 929 RSA->active_affichage(fonc_affiche);
305 couturad 919 }
306     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
307     int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
308     bool Porosite = (bool)param->get_valeur((char*)"Porosite");
309     double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
310     double Volume_min = param->get_valeur((char*)"Volume_min");
311     double Aire_min = param->get_valeur((char*)"Aire_min");
312     double Longueur_min = param->get_valeur((char*)"Longueur_min");
313     double Angle_min = param->get_valeur((char*)"Angle_min");
314     double Nb_volume_max = param->get_valeur((char*)"Nb_volume_max");
315     double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max");
316     double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
317 couturad 929 double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
318 couturad 919 if(Type_inclusion==GENERATEUR_RSA::TYPE_INCLUSION::SPHERE)
319     {
320     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
321     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
322     RSA->tirrage_aleatoire_sphere(Nom_groupe_inclusion,
323     Mu_rayon,Sigma_rayon,
324     Fraction_volumique_cible,
325     Distance_min_inter_volume,
326     Volume_min,
327     Aire_min,
328     Longueur_min,
329     Angle_min,
330     Nb_volume_max,
331     Nb_iteration_max,
332     Porosite);
333     }
334     else if(Type_inclusion==GENERATEUR_RSA::TYPE_INCLUSION::CYLINDRE)
335     {
336     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
337     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
338     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
339     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
340 couturad 929 double Mu_theta = param->get_valeur((char*)"Mu_theta");
341     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
342     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
343     double Mu_phi = param->get_valeur((char*)"Mu_phi");
344     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
345     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
346    
347 couturad 919 RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
348     Mu_rayon,Sigma_rayon,
349     Mu_longueur,Sigma_longueur,
350 couturad 929 Mu_theta,Sigma_theta,Type_distribution_theta,
351     Mu_phi,Sigma_phi,Type_distribution_phi,
352     Fraction_volumique_cible,
353     Eps_fraction_volumique,
354 couturad 919 Distance_min_inter_volume,
355     Volume_min,
356     Aire_min,
357     Longueur_min,
358     Angle_min,
359     Nb_volume_max,
360     Nb_iteration_max,
361     Porosite);
362     }
363    
364     }
365     }
366     ot_cpu.ajouter_etape((char*)"generation_geometrie");
367 couturad 926 double temps_generation_geometrie;
368     ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie);
369     change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie);
370 couturad 919 generateur->construire(this);
371     delete generateur;
372     return OK;
373     }
374    
375 couturad 926 int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau)
376 couturad 919 {
377     OT_CPU ot_cpu;
378     ot_cpu.initialise();
379     std::vector<OT_PARAMETRES*>::iterator it;
380     for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++)
381     {
382     OT_PARAMETRES* param = *it;
383     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
384     double Mu_E = param->get_valeur((char*)"Mu_E");
385     double Sigma_E = param->get_valeur((char*)"Sigma_E");
386     double Mu_nu = param->get_valeur((char*)"Mu_nu");
387     double Sigma_nu = param->get_valeur((char*)"Sigma_nu");
388 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
389     std::map<long,MG_CG_FORME*>::iterator it_forme;
390     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))
391 couturad 919 {
392     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
393     {
394     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
395     if(Sigma_E==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Mu_E);
396     else
397     {
398     std::random_device seed;
399     std::mt19937_64 generateur(seed());
400     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
401     double Em = distribution(generateur);
402     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",Em);
403     }
404     if(Sigma_nu==0.0) forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",Mu_nu);
405     else
406     {
407     std::random_device seed;
408     std::mt19937_64 generateur(seed());
409     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
410     double nu = distribution(generateur);
411     forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu);
412     }
413     }
414     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
415     {
416     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
417     std::map<long,MG_VOLUME*>::iterator it_volume;
418     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))
419     {
420     if(Sigma_E==0.0) volume->ajouter_ccf((char*)"Em",Mu_E);
421     else
422     {
423     std::random_device seed;
424     std::mt19937_64 generateur(seed());
425     std::normal_distribution<double> distribution(Mu_E,Sigma_E);
426     double Em = distribution(generateur);
427     volume->ajouter_ccf((char*)"Em",Em);
428     }
429     if(Sigma_nu==0.0) volume->ajouter_ccf((char*)"nu",Mu_nu);
430     else
431     {
432     std::random_device seed;
433     std::mt19937_64 generateur(seed());
434     std::normal_distribution<double> distribution(Mu_nu,Sigma_nu);
435     double nu = distribution(generateur);
436     volume->ajouter_ccf((char*)"nu",nu);
437     }
438     }
439     }
440     }
441     }
442     ot_cpu.ajouter_etape((char*)"generation_materiau");
443 couturad 926 double temps_generation_materiau;
444     ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau);
445     change_temps_materiau(get_temps_materiau()+temps_generation_materiau);
446 couturad 919 return OK;
447     }
448    
449 couturad 926 int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param)
450 couturad 919 {
451     double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal");
452     double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage");
453     double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction");
454     std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution");
455     std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte");
456     std::string Nom_carte = param->get_nom((char*)"Nom_carte");
457     double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min");
458     double Nb_pas = param->get_valeur((char*)"Nb_pas");
459     double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation");
460     MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE;
461 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice");
462     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume();
463 couturad 919 OT_CPU ot_cpu;
464     ot_cpu.initialise();
465     FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte,
466     m_mg_geometrie,
467     Ecart_nodal,
468     Fechantillonnage,
469     Nb_cellule_direction,
470     (char*)Nom_fem_solution.c_str(),
471     tpl_map_volume_matrice,
472     Nb_couche_min,
473     Nb_pas,
474     Facteur_augmentation);
475 couturad 926
476    
477     carte->construit();
478 couturad 919 ot_cpu.ajouter_etape((char*)"generation_carte");
479 couturad 926 double temps_generation_carte;
480     ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte);
481     change_temps_carte(get_temps_carte()+temps_generation_carte);
482     mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str());
483 couturad 919 carte->enregistrer((char*)Nom_carte.c_str());
484 couturad 926 m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str());
485 couturad 919 return OK;
486     }
487    
488 couturad 926 int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte)
489 couturad 919 {
490     OT_CPU ot_cpu;
491     ot_cpu.initialise();
492     int Niveau = (int)param->get_valeur((char*)"Niveau");
493     int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d");
494     int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d");
495     double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique");
496     int Analyse = (int)param->get_valeur((char*)"Analyse");
497     affiche((char*)"Maillage du VER :");
498     m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie);
499     m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage);
500 couturad 926 change_mg_maillage(m_mg_maillage);
501 couturad 919 MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie);
502     affiche((char*)" Maillage 0D :");
503     LISTE_MG_SOMMET::iterator it_sommet;
504     for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet))
505     {
506     char message[1000];
507     sprintf(message," -> Maillage du sommet id %li",sommet->get_id());
508     affiche(message);
509     m0d.maille(sommet);
510     }
511    
512     MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte);
513     affiche((char*)" Maillage 1D :");
514     m1d.active_affichage(fonc_affiche);
515     LISTE_MG_ARETE::iterator it_arete;
516     for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete))
517     {
518     char message[1000];
519     sprintf(message," -> Maillage de l'arete id %li",arete->get_id());
520     affiche(message);
521     m1d.maille(arete);
522     }
523     MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte);
524     m2d.change_niveau_optimisation(Niveau_opt_2d);
525     m2d.change_priorite_metrique(Priorite_metrique);
526     affiche((char*)" Maillage 2D :");
527     m2d.active_affichage(fonc_affiche);
528     LISTE_MG_FACE::iterator it_face;
529     for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
530     {
531     char message[1000];
532     sprintf(message," -> Maillage de la face id %li",face->get_id());
533     affiche(message);
534     m2d.maille(face);
535     }
536     MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false);
537     m3d.change_niveau_optimisation(Niveau_opt_2d);
538     m3d.change_priorite_metrique(Priorite_metrique);
539     affiche((char*)" Maillage 3D :");
540     m3d.active_affichage(fonc_affiche);
541     LISTE_MG_VOLUME::iterator it_volume;
542     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
543     {
544     char message[1000];
545     sprintf(message," -> Maillage du volume id %li",volume->get_id());
546     affiche(message);
547     m3d.maille(volume);
548     }
549     ot_cpu.ajouter_etape((char*)"generation_maillage");
550 couturad 926 double temps_generation_maillage;
551     ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage);
552     change_temps_maillage(get_temps_maillage()+temps_generation_maillage);
553 couturad 919 return OK;
554     }
555    
556 couturad 926 int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param)
557 couturad 919 {
558     OT_CPU ot_cpu;
559     ot_cpu.initialise();
560     int Degre = (int)param->get_valeur((char*)"Degre");
561     int Analyse = (int)param->get_valeur((char*)"Analyse");
562     int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud");
563     MAILLEUR_FEM mailleurfem;
564     mailleurfem.active_affichage(fonc_affiche);
565 couturad 926 m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre);
566 couturad 919 m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage);
567 couturad 926 change_fem_maillage(m_fem_maillage);
568 couturad 919 if(Optimisation_num_noeud) mailleurfem.maille(m_fem_maillage,1);
569     else mailleurfem.maille(m_fem_maillage,0);
570     if(Analyse)
571     {
572     MAILLEUR_ANALYSE m3d(m_fem_maillage);
573     m3d.active_affichage(fonc_affiche);
574     // m3d.analyse();
575     }
576     ot_cpu.ajouter_etape((char*)"generation_fem_maillage");
577 couturad 926 double temps_generation_fem_maillage;
578     ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage);
579     change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage);
580 couturad 919 return OK;
581     }
582    
583 couturad 926 int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param)
584 couturad 919 {
585     OT_CPU ot_cpu;
586     ot_cpu.initialise();
587 couturad 926 BOITE_3D boite3D_ves = get_boite3d_ves();
588     double eps = get_precision();
589 couturad 919 TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
590     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
591     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
592     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
593     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
594     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
595     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
596     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
597     {
598     double xyzmin[3];
599     double xyzmax[3];
600     face->get_xyz_min_max(xyzmin,xyzmax,16);
601    
602 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);
603     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);
604     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);
605     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);
606     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);
607     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);
608 couturad 919 }
609     MG_SOMMET* sommet_origine;
610     MG_SOMMET* sommet_x1y0z0;
611     MG_SOMMET* sommet_x0y1z0;
612     MG_SOMMET* sommet_x0y0z1;
613     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
614     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
615     {
616     double xyz[3];
617     som->get_point()->evaluer(xyz);
618 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;
619     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;
620     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;
621     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;
622 couturad 919 }
623     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
624     int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement");
625     int Type_CL = (int)param->get_valeur((char*)"Type_CL");
626     double Valeur_CL = param->get_valeur((char*)"Valeur_CL");
627     if(Type_etude==TYPE_ETUDE::MECANIQUE)
628     {
629     if(Type_Chargement==TYPE_CHARGEMENT::SPHERIQUE)
630     {
631     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
632     {
633     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
634     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",Valeur_CL,true);
635     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
636     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",Valeur_CL,true);
637     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
638     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",Valeur_CL,true);
639     }
640     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
641     {
642     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true);
643     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Pz",Valeur_CL,false);
644     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true);
645     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Px",Valeur_CL,false);
646     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true);
647     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Py",Valeur_CL,false);
648     }
649     }
650     else if(Type_Chargement==TYPE_CHARGEMENT::DEVIATORIQUE)
651     {
652     if(Type_CL==TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE)
653     {
654     char chr_valeur_cl[1000];
655     sprintf(chr_valeur_cl,"%lf",Valeur_CL);
656     std::string str_valeur_cl = chr_valeur_cl;
657     std::string formule_Dx = str_valeur_cl+ "*Y";
658     std::string formule_Dy = str_valeur_cl+ "*Z";
659     std::string formule_Dz = str_valeur_cl+ "*X";
660     std::vector<std::string> liste_variable_formule_Dx;
661     std::vector<std::string> liste_variable_formule_Dy;
662     std::vector<std::string> liste_variable_formule_Dz;
663     liste_variable_formule_Dx.push_back((std::string)"Y");
664     liste_variable_formule_Dy.push_back((std::string)"Z");
665     liste_variable_formule_Dz.push_back((std::string)"X");
666     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
667     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
668     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
669     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
670     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
671     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
672     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
673     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
674     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
675     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
676     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
677     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
678     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
679     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
680     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
681     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true);
682     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true);
683     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true);
684     }
685     else if(Type_CL==TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE)
686     {
687     sommet_origine->ajouter_ccf((char*)"Dt",0.0);
688     sommet_x1y0z0->ajouter_ccf((char*)"Dy",0.0);
689     sommet_x1y0z0->ajouter_ccf((char*)"Dz",0.0);
690     sommet_x0y1z0->ajouter_ccf((char*)"Dz",0.0);
691     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Px",-Valeur_CL,true);
692     appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Py",-Valeur_CL,true);
693     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Px",Valeur_CL,true);
694     appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Py",Valeur_CL,true);
695     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Px",-Valeur_CL,true);
696     appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Pz",-Valeur_CL,true);
697     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Px",Valeur_CL,true);
698     appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Pz",Valeur_CL,true);
699     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Py",-Valeur_CL,true);
700     appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Pz",-Valeur_CL,true);
701     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Py",Valeur_CL,true);
702     appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Pz",Valeur_CL,true);
703     }
704     }
705     }
706     ot_cpu.ajouter_etape((char*)"generation_etude");
707 couturad 926 double temps_generation_etude;
708     ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude);
709     change_temps_etude(get_temps_etude()+temps_generation_etude);
710 couturad 919 return OK;
711     }
712    
713 couturad 926 int MSTRUCT_VES::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, double valeur,bool topo_sous_jacente)
714 couturad 919 {
715     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
716     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
717     {
718     face->ajouter_ccf(condition,valeur);
719     if(topo_sous_jacente==true)
720     {
721     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
722     face->get_topologie_sousjacente(&map_topo);
723     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
724     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
725     {
726     topo->ajouter_ccf(condition,valeur);
727     }
728     }
729     }
730     }
731    
732 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)
733 couturad 919 {
734     TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
735     for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan))
736     {
737     face->ajouter_ccf(condition,formule,listvariable);
738     if(topo_sous_jacente==true)
739     {
740     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo;
741     face->get_topologie_sousjacente(&map_topo);
742     TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo;
743     for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo))
744     {
745     topo->ajouter_ccf(condition,formule,listvariable);
746     }
747     }
748     }
749     }
750    
751 couturad 926 int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster)
752 couturad 919 {
753     std::string Nom_etude = param->get_nom((char*)"Nom_etude");
754     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
755     int Type_calcul = (int)param->get_valeur((char*)"Type_calcul");
756     std::string Code_resu = param->get_nom((char*)"Code_resu");
757     MGASTER mgaster;
758     mgaster.active_affichage(fonc_affiche);
759     OT_CPU ot_cpu;
760     ot_cpu.initialise();
761     mgaster.calcule(param_aster,m_fem_maillage,(char*)Nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str());
762     ot_cpu.ajouter_etape((char*)"calcul");
763 couturad 926 double temps_calcul;
764     ot_cpu.get_etape((char*)"calcul",temps_calcul);
765     change_temps_calcul(get_temps_calcul()+temps_calcul);
766 couturad 919 }
767    
768 couturad 926 int MSTRUCT_VES::generer_analyse(std::vector< OT_PARAMETRES* >& vector_params_analyse)
769 couturad 919 {
770 couturad 926 OT_CPU ot_cpu;
771     ot_cpu.initialise();
772     std::vector<OT_PARAMETRES*>::iterator it;
773     for(it=vector_params_analyse.begin();it!=vector_params_analyse.end();it++)
774 couturad 919 {
775 couturad 926 OT_PARAMETRES* param = *it;
776     std::string Identifiant = param->get_nom((char*)"Identifiant");
777     if(get_analyse(Identifiant)!=NULL)
778     {
779     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
780     continue;
781     }
782     char ligne[1000];
783     sprintf(ligne,"-> %s",Identifiant.c_str());
784     affiche(ligne);
785     int Type_analyse = (int)param->get_valeur((char*)"Type_analyse");
786     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
787     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
788     BOITE_3D *boite_3d_analyse=NULL;
789     if(Boite_analyse)
790     {
791     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
792     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
793     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
794     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
795     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
796     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
797     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
798     }
799     if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CHAMP)
800     {
801     long Num_solution = (long)param->get_valeur((char*)"Num_solution");
802     FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution);
803     int nb_champ = sol->get_nb_champ();
804     double Largeur_colonne = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
805     MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(Identifiant,sol->get_id(),nb_champ,Largeur_colonne,Nom_groupe_forme,boite_3d_analyse);
806     analyse_champ->executer(this);
807     ajouter_analyse(analyse_champ);
808     }
809     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::ORIENTATION)
810     {
811     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(Identifiant,Nom_groupe_forme,boite_3d_analyse);
812     analyse_orientation->executer(this);
813     ajouter_analyse(analyse_orientation);
814     }
815     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::CAO)
816     {
817     double Largeur_colonne_distribution_nb_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_volume");
818     double Largeur_colonne_distribution_nb_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_forme");
819     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
820     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
821     double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme");
822     MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(Identifiant,
823     Largeur_colonne_distribution_nb_volume,
824     Largeur_colonne_distribution_nb_forme,
825     Largeur_colonne_distribution_volume,
826     Largeur_colonne_distribution_fraction_volumique,
827     Largeur_colonne_distribution_volume_forme,
828     Nom_groupe_forme);
829     analyse_cao->executer(this);
830     ajouter_analyse(analyse_cao);
831     }
832     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_MG)
833     {
834     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
835     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
836     double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D");
837     double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D");
838     double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D");
839     double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D");
840     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
841     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
842    
843     MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(Identifiant,
844     m_mg_maillage->get_id(),
845     Largeur_colonne_distribution_qualite_2D,
846     Largeur_colonne_distribution_nb_element_2D,
847     Largeur_colonne_distribution_nb_element_3D,
848     Largeur_colonne_distribution_taille_2D,
849     Largeur_colonne_distribution_qualite_3D,
850     Largeur_colonne_distribution_taille_3D,
851     Largeur_colonne_distribution_volume,
852     Largeur_colonne_distribution_fraction_volumique,
853     Nom_groupe_forme);
854     analyse_mg_maillage->executer(this);
855     ajouter_analyse(analyse_mg_maillage);
856     }
857     else if(Type_analyse==MSTRUCT_ANALYSE::TYPE_ANALYSE::MAILLAGE_FEM)
858     {
859     double Largeur_colonne_distribution_nb_element_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_2D");
860     double Largeur_colonne_distribution_nb_element_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_nb_element_3D");
861     double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min");
862     double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max");
863     double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min");
864     double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max");
865     double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D");
866     double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D");
867     double Largeur_colonne_distribution_volume = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume");
868     double Largeur_colonne_distribution_fraction_volumique = (double)param->get_valeur((char*)"Largeur_colonne_distribution_fraction_volumique");
869     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(Identifiant,
870     m_fem_maillage->get_id(),
871     Largeur_colonne_distribution_nb_element_2D,
872     Largeur_colonne_distribution_nb_element_3D,
873     Largeur_colonne_distribution_jacobien_2D_min,
874     Largeur_colonne_distribution_jacobien_2D_max,
875     Largeur_colonne_distribution_jacobien_3D_min,
876     Largeur_colonne_distribution_jacobien_3D_max,
877     Largeur_colonne_distribution_distortion_2D,
878     Largeur_colonne_distribution_distortion_3D,
879     Largeur_colonne_distribution_volume,
880     Largeur_colonne_distribution_fraction_volumique,
881     Nom_groupe_forme,
882     boite_3d_analyse);
883     analyse_maillage_fem->executer(this);
884     ajouter_analyse(analyse_maillage_fem);
885     }
886     if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
887 couturad 919 }
888 couturad 926 ot_cpu.ajouter_etape((char*)"analyse");
889     double temps_analyse;
890     ot_cpu.get_etape((char*)"analyse",temps_analyse);
891     change_temps_analyse(get_temps_analyse()+temps_analyse);
892 couturad 919 }
893    
894 couturad 926
895     int MSTRUCT_VES::enregistrer(char* fichier_ves)
896 couturad 919 {
897 couturad 926 m_ves_file->enregistrer(fichier_ves);
898 couturad 919 }
899    
900 couturad 926 int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic)
901 couturad 919 {
902 couturad 926 m_ves_file->change_nom_fichier_magic(fichier_magic);
903     m_ves_file->enregistrer(fichier_ves);
904     m_mg_gestionnaire->enregistrer(fichier_magic);
905 couturad 919 }
906    
907 couturad 926 void MSTRUCT_VES::active_affichage(MICROSTRUCTURE::fonction_affiche* fonc)
908 couturad 919 {
909     fonc_affiche = fonc;
910     affichageactif = 1;
911     }
912    
913 couturad 926 void MSTRUCT_VES::affiche(char* message)
914 couturad 919 {
915     if(affichageactif==1) fonc_affiche(message);
916     }
917    
918    
919    
920    
921