ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 1190
Committed: Wed May 21 19:10:51 2025 UTC (5 weeks, 2 days ago) by ghazal
File size: 119239 byte(s)
Log Message:
Ajout de la méthode GCM dans la génération de microstructure.

File Contents

# User Rev Content
1 francois 1158 //####//------------------------------------------------------------
2     //####//------------------------------------------------------------
3     //####// MAGiC
4     //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5     //####// Departement de Genie Mecanique - UQTR
6     //####//------------------------------------------------------------
7     //####// MAGIC est un projet de recherche de l equipe ERICCA
8     //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9     //####// http://www.uqtr.ca/ericca
10     //####// http://www.uqtr.ca/
11     //####//------------------------------------------------------------
12     //####//------------------------------------------------------------
13     //####//
14     //####// mstruct_ves.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:57 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 couturad 919 #include "mstruct_ves.h"
23     #include "mg_volume.h"
24     #include "mg_geometrie.h"
25     #include "mg_maillage.h"
26     #include "fem_maillage.h"
27     #include "mg_gestionnaire.h"
28     #include "mstruct_groupe_volume.h"
29     #include "mstruct_parametres.h"
30     #include "mstruct_generateur_rsa.h"
31 couturad 951 #include "mstruct_generateur_dcr.h"
32 couturad 968 #include "mstruct_definition.h"
33     #include "mstruct_analyse_champ.h"
34     #include "mstruct_analyse_orientation.h"
35     #include "mstruct_analyse_cao.h"
36 couturad 971 #include "mstruct_analyse_propriete_massique.h"
37 couturad 968 #include "mstruct_analyse_mg_maillage.h"
38     #include "mstruct_analyse_fem_maillage.h"
39     #include "mstruct_analyse_erosion.h"
40     #include "mstruct_analyse_modules_elasticite.h"
41 couturad 971 #include "mstruct_analyse_conductivite_thermique.h"
42 couturad 1029 #include "mstruct_analyse_energie_hill.h"
43 couturad 919 #include "mg_cg_modele.h"
44     #include "mg_cg_assemblage.h"
45     #include "mg_sous_geometrie.h"
46     #include "mg_cg_forme_multi_volume.h"
47 couturad 937 #include "mg_cg_info.h"
48 couturad 919 #include "mg_file.h"
49     #include "fct_taille_fem_solution_generateur_microstructure.h"
50 couturad 951 #include "mailleur3d_couche.h"
51 couturad 919 #include "mailleur0d.h"
52     #include "mailleur1d.h"
53     #include "mailleur2d.h"
54     #include "mailleur3d.h"
55     #include "mailleur_fem.h"
56 couturad 1029 #include "mailleur3d_structure.h"
57 couturad 919 #include "mailleur_analyse.h"
58     #include <fstream>
59     #include "mgaster.h"
60     #include "ot_cpu.h"
61     #include "mstruct_outils.h"
62 couturad 926 #include "mg_cg_groupe_forme.h"
63     #include "mstruct_ves_file.h"
64 couturad 1029 #include "fem_triangle3.h"
65     #include "fem_triangle6.h"
66 couturad 933 #include "fem_tetra4.h"
67     #include "fem_tetra10.h"
68     #include "fem_penta6.h"
69     #include "fem_penta15.h"
70 couturad 1029 #include "mg_hexa.h"
71     #include "tpl_grille.h"
72 couturad 951 #include "parse.h"
73     #include "pars_argument.h"
74 couturad 1029 #include "ot_geometrie.h"
75 francois 1132 MSTRUCT_VES::MSTRUCT_VES(OT_PARAMETRES *param)
76 couturad 919 {
77     m_mg_gestionnaire=new MG_GESTIONNAIRE;
78     m_mg_geometrie=NULL;
79     m_mgcg_modele=NULL;
80 couturad 926 m_mgcg_assemblage=NULL;
81 couturad 919 m_mg_maillage=NULL;
82     m_fem_maillage=NULL;
83 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
84 francois 1132 int decoup=(int)param->get_valeur("Avec_decoup");
85     if (decoup==0) change_boite_3D_ves(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0));
86 ghazal 1190 else
87 francois 1132 {
88     double xmin=(double)param->get_valeur("Boite3D_ves_Xmin");
89     double ymin=(double)param->get_valeur("Boite3D_ves_Ymin");
90     double zmin=(double)param->get_valeur("Boite3D_ves_Zmin");
91     double xmax=(double)param->get_valeur("Boite3D_ves_Xmax");
92     double ymax=(double)param->get_valeur("Boite3D_ves_Ymax");
93     double zmax=(double)param->get_valeur("Boite3D_ves_Zmax");
94 ghazal 1190 change_boite_3D_ves(BOITE_3D(xmin,ymin,zmin,xmax,ymax,zmax));
95 francois 1132 }
96 couturad 926 change_precision(1.0e-06);
97     change_temps_geometrie(0.0);
98     change_temps_carte(0.0);
99     change_temps_maillage(0.0);
100     change_temps_fem_maillage(0.0);
101     change_temps_etude(0.0);
102     change_temps_calcul(0.0);
103     change_temps_analyse(0.0);
104 couturad 919 }
105    
106 couturad 926 MSTRUCT_VES::MSTRUCT_VES(char* fichier_ves)
107 couturad 919 {
108 couturad 926 m_ves_file=new MSTRUCT_VES_FILE;
109     m_ves_file->ouvrir(fichier_ves);
110 ghazal 1190 m_mg_gestionnaire = new MG_FILE(m_ves_file->get_nom_fichier_magic());
111 couturad 926 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());
112     else m_mgcg_modele=NULL;
113     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());
114     else m_mgcg_assemblage=NULL;
115     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());
116     else m_mg_geometrie = NULL;
117     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());
118     else m_mg_maillage = NULL;
119     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());
120     else m_fem_maillage = NULL;
121 couturad 919 }
122    
123 couturad 926 MSTRUCT_VES::~MSTRUCT_VES(void)
124 couturad 919 {
125     delete m_mg_gestionnaire;
126 couturad 926 delete m_ves_file;
127 couturad 919 }
128    
129 couturad 926 MG_GESTIONNAIRE* MSTRUCT_VES::get_mg_gestionnaire(void)
130 couturad 919 {
131     return m_mg_gestionnaire;
132     }
133    
134 couturad 926 void MSTRUCT_VES::change_mg_gestionnaire(MG_GESTIONNAIRE* gest)
135 couturad 919 {
136 couturad 926 m_mg_gestionnaire=gest;
137     }
138    
139     void MSTRUCT_VES::change_mg_geometrie(MG_GEOMETRIE* mg_geometrie)
140     {
141 couturad 919 m_mg_geometrie=mg_geometrie;
142 couturad 926 m_ves_file->change_id_mg_geometrie(m_mg_geometrie->get_id());
143 couturad 919 }
144    
145 couturad 926 MG_GEOMETRIE* MSTRUCT_VES::get_mg_geometrie(void)
146 couturad 919 {
147     return m_mg_geometrie;
148     }
149    
150 couturad 926 void MSTRUCT_VES::change_mgcg_assemblage(MG_CG_ASSEMBLAGE* mgcg_assemblage)
151 couturad 919 {
152     m_mgcg_assemblage=mgcg_assemblage;
153 ghazal 1130 if (m_mgcg_assemblage!=NULL) m_ves_file->change_id_mgcg_assemblage(m_mgcg_assemblage->get_id());
154     else m_ves_file->change_id_mgcg_assemblage(-1);
155 couturad 919 }
156    
157 couturad 926 MG_CG_ASSEMBLAGE* MSTRUCT_VES::get_mgcg_assemblage(void)
158 couturad 919 {
159     return m_mgcg_assemblage;
160     }
161    
162 couturad 926 void MSTRUCT_VES::change_mgcg_modele(MG_CG_MODELE* mgcg_modele)
163 couturad 919 {
164     m_mgcg_modele=mgcg_modele;
165 ghazal 1130 if (m_mgcg_modele!=NULL) m_ves_file->change_id_mgcg_modele(m_mgcg_modele->get_id());
166     else m_ves_file->change_id_mgcg_modele(-1);
167 couturad 919 }
168    
169 couturad 926 MG_CG_MODELE* MSTRUCT_VES::get_mgcg_modele(void)
170 couturad 919 {
171     return m_mgcg_modele;
172     }
173    
174 couturad 926 MG_MAILLAGE* MSTRUCT_VES::get_mg_maillage(void)
175 couturad 919 {
176     return m_mg_maillage;
177     }
178    
179 couturad 926 void MSTRUCT_VES::change_mg_maillage(MG_MAILLAGE* mg_maillage)
180 couturad 919 {
181     m_mg_maillage=mg_maillage;
182 couturad 926 m_ves_file->change_id_mg_maillage(m_mg_maillage->get_id());
183 couturad 919 }
184    
185 couturad 926 FEM_MAILLAGE* MSTRUCT_VES::get_fem_maillage(void)
186 couturad 919 {
187     return m_fem_maillage;
188     }
189    
190 couturad 926 void MSTRUCT_VES::change_fem_maillage(FEM_MAILLAGE* fem_maillage)
191 couturad 919 {
192     m_fem_maillage=fem_maillage;
193 couturad 926 m_ves_file->change_id_fem_maillage(m_fem_maillage->get_id());
194 couturad 919 }
195    
196 couturad 926 BOITE_3D MSTRUCT_VES::get_boite3d_ves(void)
197 couturad 919 {
198 couturad 926 return m_ves_file->get_boite_3D_ves();
199 couturad 919 }
200    
201 couturad 926 void MSTRUCT_VES::change_boite_3D_ves(BOITE_3D boite3D)
202 couturad 919 {
203 couturad 926 m_ves_file->change_boite_3D_ves(boite3D);
204 couturad 919 }
205    
206 couturad 926 double MSTRUCT_VES::get_precision(void)
207 couturad 919 {
208 couturad 926 return m_ves_file->get_precision();
209 couturad 919 }
210    
211 couturad 926 void MSTRUCT_VES::change_precision(double precision)
212 couturad 919 {
213 couturad 926 m_ves_file->change_precision(precision);
214 couturad 919 }
215    
216 couturad 926 double MSTRUCT_VES::get_temps_geometrie(void)
217 couturad 919 {
218 couturad 926 return m_ves_file->get_temps_geometrie();
219 couturad 919 }
220    
221 couturad 926 void MSTRUCT_VES::change_temps_geometrie(double temps)
222 couturad 919 {
223 couturad 926 m_ves_file->change_temps_geometrie(temps);
224 couturad 919 }
225    
226 couturad 926 double MSTRUCT_VES::get_temps_materiau(void)
227     {
228     return m_ves_file->get_temps_materiau();
229     }
230 couturad 919
231 couturad 926 void MSTRUCT_VES::change_temps_materiau(double temps)
232 couturad 919 {
233 couturad 926 m_ves_file->change_temps_materiau(temps);
234     }
235    
236     double MSTRUCT_VES::get_temps_carte(void)
237     {
238     return m_ves_file->get_temps_carte();
239     }
240    
241     void MSTRUCT_VES::change_temps_carte(double temps)
242     {
243     m_ves_file->change_temps_carte(temps);
244     }
245    
246     double MSTRUCT_VES::get_temps_maillage(void)
247     {
248     return m_ves_file->get_temps_maillage();
249     }
250    
251     void MSTRUCT_VES::change_temps_maillage(double temps)
252     {
253     m_ves_file->change_temps_maillage(temps);
254     }
255    
256     double MSTRUCT_VES::get_temps_fem_maillage(void)
257     {
258     return m_ves_file->get_temps_fem_maillage();
259     }
260    
261     void MSTRUCT_VES::change_temps_fem_maillage(double temps)
262     {
263     m_ves_file->change_temps_fem_maillage(temps);
264     }
265    
266     double MSTRUCT_VES::get_temps_etude(void)
267     {
268     return m_ves_file->get_temps_etude();
269     }
270    
271     void MSTRUCT_VES::change_temps_etude(double temps)
272     {
273     m_ves_file->change_temps_etude(temps);
274     }
275    
276     double MSTRUCT_VES::get_temps_calcul(void)
277     {
278     return m_ves_file->get_temps_calcul();
279     }
280    
281     void MSTRUCT_VES::change_temps_calcul(double temps)
282     {
283     m_ves_file->change_temps_calcul(temps);
284     }
285    
286     double MSTRUCT_VES::get_temps_analyse(void)
287     {
288     return m_ves_file->get_temps_analyse();
289     }
290    
291     void MSTRUCT_VES::change_temps_analyse(double temps)
292     {
293     m_ves_file->change_temps_analyse(temps);
294     }
295    
296     long int MSTRUCT_VES::get_nb_analyse(void)
297     {
298     return m_ves_file->get_nb_analyse();
299     }
300    
301     int MSTRUCT_VES::ajouter_analyse(MSTRUCT_ANALYSE* analyse_ves)
302     {
303     return m_ves_file->ajouter_analyse(analyse_ves);
304     }
305    
306     MSTRUCT_ANALYSE* MSTRUCT_VES::get_premiere_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
307     {
308     return m_ves_file->get_premiere_analyse(it);
309     }
310    
311     MSTRUCT_ANALYSE* MSTRUCT_VES::get_suivante_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it)
312     {
313     return m_ves_file->get_suivante_analyse(it);
314     }
315    
316 couturad 951 MSTRUCT_ANALYSE* MSTRUCT_VES::get_analyse(std::string identifiant)
317 couturad 926 {
318     return m_ves_file->get_analyse(identifiant);
319     }
320    
321 couturad 951 int MSTRUCT_VES::supprimer_analyse(std::string identifiant)
322 couturad 926 {
323     return m_ves_file->supprimer_analyse(identifiant);
324     }
325    
326     int MSTRUCT_VES::supprimer_tout_analyse(void)
327     {
328     return m_ves_file->supprimer_tout_analyse();
329     }
330    
331 ghazal 1092
332 couturad 926 int MSTRUCT_VES::generer_geometrie(std::vector< OT_PARAMETRES* >& vector_params_geometrie)
333     {
334 couturad 919 OT_CPU ot_cpu;
335     ot_cpu.initialise();
336 couturad 951 MSTRUCT_GENERATEUR* generateur=NULL;
337 couturad 919 std::vector<OT_PARAMETRES*>::iterator it;
338     for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++)
339     {
340     OT_PARAMETRES* param = *it;
341 couturad 968 if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::RSA)
342 couturad 919 {
343     std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
344 couturad 951 MSTRUCT_GENERATEUR_RSA *RSA;
345     if(generateur==NULL)
346     {
347     RSA = new MSTRUCT_GENERATEUR_RSA(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
348 ghazal 1190 generateur=RSA;
349 couturad 951 RSA->active_affichage(fonc_affiche);
350     }
351 ghazal 1190
352 couturad 919 double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
353     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
354     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
355     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
356     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
357     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
358     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
359     Boite3D_distribution_Ymin,
360     Boite3D_distribution_Zmin,
361     Boite3D_distribution_Xmax,
362     Boite3D_distribution_Ymax,
363     Boite3D_distribution_Zmax);
364 couturad 951 RSA->change_boite3d_distribution(Boite3D_distribution);
365 ghazal 1190 //----------------------------------------------------------------------
366     //Ajouter decoupage pour RSA
367     //----------------------------------------------------------------------
368    
369     int decoup=(int)param->get_valeur((char*)"Avec_decoup");
370     if (decoup==1)
371     {
372     double Boite3D_ves_Xmin = param->get_valeur((char*)"Boite3D_ves_Xmin");
373     double Boite3D_ves_Ymin = param->get_valeur((char*)"Boite3D_ves_Ymin");
374     double Boite3D_ves_Zmin = param->get_valeur((char*)"Boite3D_ves_Zmin");
375     double Boite3D_ves_Xmax = param->get_valeur((char*)"Boite3D_ves_Xmax");
376     double Boite3D_ves_Ymax = param->get_valeur((char*)"Boite3D_ves_Ymax");
377     double Boite3D_ves_Zmax = param->get_valeur((char*)"Boite3D_ves_Zmax");
378     BOITE_3D Boite3D_ves(Boite3D_ves_Xmin,Boite3D_ves_Ymin,Boite3D_ves_Zmin,Boite3D_ves_Xmax,Boite3D_ves_Ymax,Boite3D_ves_Zmax);
379     RSA->change_boite3d_ves(Boite3D_ves);
380     }
381     //----------------------------------------------------------------------
382 couturad 919 double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
383     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
384 ghazal 1190 double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
385     RSA->change_nb_pas_grille(Nb_pas_X);
386 couturad 951 double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
387     RSA->change_distance_inter_volume_min(Distance_min_inter_volume);
388 couturad 919 double Volume_min = param->get_valeur((char*)"Volume_min");
389 couturad 951 RSA->change_volume_min(Volume_min);
390 couturad 919 double Aire_min = param->get_valeur((char*)"Aire_min");
391 couturad 951 RSA->change_aire_min(Aire_min);
392 couturad 919 double Longueur_min = param->get_valeur((char*)"Longueur_min");
393 couturad 951 RSA->change_longueur_min(Longueur_min);
394 couturad 919 double Angle_min = param->get_valeur((char*)"Angle_min");
395 couturad 951 RSA->change_angle_min(Angle_min);
396 couturad 919 double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max");
397 ghazal 1190 RSA->change_nb_iteration_max(Nb_iteration_max);
398 couturad 951 bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
399     RSA->change_intersection_bords_ves(Avec_intersections);
400     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
401 couturad 971 char message[1000];
402     sprintf(message,"Generateur RSA : %s",Nom_groupe_inclusion.c_str());
403     affiche(message);
404 couturad 951 int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
405 couturad 919 double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
406 ghazal 1190 double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
407 couturad 951 bool Porosite = (bool)param->get_valeur((char*)"Porosite");
408     std::string multicouche = param->get_nom((char*)"Multicouche");
409     PARS_ARGUMENT parse_param[100];
410     PARSE parse;
411     parse.decode(multicouche.c_str(),"@,(&)",parse_param);
412     std::vector<double> *vector_epaisseur=NULL;
413     int nb_couche = atoi(parse_param[0].argument[0].c_str());
414     if(nb_couche>0)
415 couturad 919 {
416 couturad 951 vector_epaisseur=new std::vector<double>;
417     for(int i=0;i<nb_couche;i++)
418     {
419     double epaisseur=atof(parse_param[1].argument[i].c_str());
420     vector_epaisseur->push_back(epaisseur);
421     }
422 ghazal 1190 }
423 couturad 968 if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE)
424 couturad 951 {
425 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
426     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
427     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
428     double fraction_volumique_actuelle=0.0;
429     RSA->tirrage_aleatoire_sphere(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,vector_epaisseur,Porosite);
430 couturad 919 }
431 couturad 968 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE)
432 couturad 919 {
433 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
434     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
435     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
436     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
437     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
438     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
439     double Mu_theta = param->get_valeur((char*)"Mu_theta");
440     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
441     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
442     double Mu_phi = param->get_valeur((char*)"Mu_phi");
443     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
444     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
445     double fraction_volumique_actuelle=0.0;
446     RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion,
447     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
448     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
449     Mu_theta,Sigma_theta,Type_distribution_theta,
450     Mu_phi,Sigma_phi,Type_distribution_phi,
451     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
452     vector_epaisseur,
453     Porosite);
454 couturad 919 }
455 ghazal 1092 //----------------------------------------------------------------------------------
456     else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::TORUS)
457     {
458     double Mu_rayon_cercle = param->get_valeur((char*)"Mu_rayon_cercle");
459     double Sigma_rayon_cercle = param->get_valeur((char*)"Sigma_rayon_cercle");
460     double Type_distribution_rayon_cercle = param->get_valeur((char*)"Type_distribution_rayon_cercle");
461 ghazal 1190
462 ghazal 1092 double Mu_rayon_tore = param->get_valeur((char*)"Mu_rayon_tore");
463     double Sigma_rayon_tore = param->get_valeur((char*)"Sigma_rayon_tore");
464     double Type_distribution_rayon_tore = param->get_valeur((char*)"Type_distribution_rayon_tore");
465 ghazal 1190
466 ghazal 1092 double Mu_theta = param->get_valeur((char*)"Mu_theta");
467     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
468     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
469 ghazal 1190
470 ghazal 1092 double Mu_phi = param->get_valeur((char*)"Mu_phi");
471     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
472     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
473    
474    
475 ghazal 1190
476    
477 francois 1095 double Mu_angle_seg = param->get_valeur((char*)"Mu_longueur");
478     double Sigma_angle_seg = param->get_valeur((char*)"Sigma_longueur");
479     double Type_distribution_angle_seg = param->get_valeur((char*)"Type_distribution_longueur");
480     Mu_angle_seg=Mu_angle_seg/Mu_rayon_cercle;
481     Sigma_angle_seg=Sigma_angle_seg/Mu_rayon_cercle;
482 ghazal 1092
483 ghazal 1190
484    
485 ghazal 1092 double fraction_volumique_actuelle=0.0;
486     RSA->tirrage_aleatoire_torus(Nom_groupe_inclusion,
487     Mu_rayon_cercle,Sigma_rayon_cercle,Type_distribution_rayon_cercle,
488     Mu_rayon_tore,Sigma_rayon_tore,Type_distribution_rayon_tore,
489     Mu_theta,Sigma_theta,Type_distribution_theta,
490     Mu_phi,Sigma_phi,Type_distribution_phi,
491     Mu_angle_seg, Sigma_angle_seg, Type_distribution_angle_seg,
492     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
493     vector_epaisseur,
494     Porosite);
495     }
496     //---------------------------------------------------------------------------
497 couturad 993 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::ELLIPSOIDE)
498     {
499     double Mu_rayon_majeur = param->get_valeur((char*)"Mu_rayon_majeur");
500     double Sigma_rayon_majeur = param->get_valeur((char*)"Sigma_rayon_majeur");
501     double Type_distribution_rayon_majeur = param->get_valeur((char*)"Type_distribution_rayon_majeur");
502     double Mu_rayon_mineur = param->get_valeur((char*)"Mu_rayon_mineur");
503     double Sigma_rayon_mineur = param->get_valeur((char*)"Sigma_rayon_mineur");
504     double Type_distribution_rayon_mineur = param->get_valeur((char*)"Type_distribution_rayon_mineur");
505     double Mu_theta = param->get_valeur((char*)"Mu_theta");
506     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
507     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
508     double Mu_phi = param->get_valeur((char*)"Mu_phi");
509     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
510     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
511     double fraction_volumique_actuelle=0.0;
512     RSA->tirrage_aleatoire_ellipsoide(Nom_groupe_inclusion,
513     Mu_rayon_majeur,Sigma_rayon_majeur,Type_distribution_rayon_majeur,
514     Mu_rayon_mineur,Sigma_rayon_mineur,Type_distribution_rayon_mineur,
515     Mu_theta,Sigma_theta,Type_distribution_theta,
516     Mu_phi,Sigma_phi,Type_distribution_phi,
517     Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle,
518     vector_epaisseur,
519     Porosite);
520     }
521 couturad 951 if(vector_epaisseur!=NULL) delete vector_epaisseur;
522     }
523 couturad 968 else if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::DCR)
524 couturad 951 {
525 couturad 952 #ifdef PROJECT_CHRONO
526 couturad 951 std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele");
527     MSTRUCT_GENERATEUR_DCR *DCR;
528     if(generateur==NULL)
529     {
530     DCR = new MSTRUCT_GENERATEUR_DCR(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str());
531 ghazal 1190 generateur=DCR;
532 couturad 951 DCR->active_affichage(fonc_affiche);
533 ghazal 1190 }
534 couturad 951 double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin");
535     double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin");
536     double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin");
537     double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax");
538     double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax");
539     double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax");
540     BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin,
541     Boite3D_distribution_Ymin,
542     Boite3D_distribution_Zmin,
543     Boite3D_distribution_Xmax,
544     Boite3D_distribution_Ymax,
545     Boite3D_distribution_Zmax);
546     DCR->change_boite3d_distribution(Boite3D_distribution);
547 francois 1132 int decoup=(int)param->get_valeur((char*)"Avec_decoup");
548     if (decoup==1)
549     {
550     double Boite3D_ves_Xmin = param->get_valeur((char*)"Boite3D_ves_Xmin");
551     double Boite3D_ves_Ymin = param->get_valeur((char*)"Boite3D_ves_Ymin");
552     double Boite3D_ves_Zmin = param->get_valeur((char*)"Boite3D_ves_Zmin");
553     double Boite3D_ves_Xmax = param->get_valeur((char*)"Boite3D_ves_Xmax");
554     double Boite3D_ves_Ymax = param->get_valeur((char*)"Boite3D_ves_Ymax");
555     double Boite3D_ves_Zmax = param->get_valeur((char*)"Boite3D_ves_Zmax");
556     BOITE_3D Boite3D_ves(Boite3D_ves_Xmin,Boite3D_ves_Ymin,Boite3D_ves_Zmin,Boite3D_ves_Xmax,Boite3D_ves_Ymax,Boite3D_ves_Zmax);
557     DCR->change_boite3d_ves(Boite3D_ves);
558     }
559 couturad 951 double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X");
560     double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y");
561 ghazal 1190 double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z");
562     DCR->change_nb_pas_grille(Nb_pas_X);
563 couturad 951 double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume");
564     DCR->change_distance_inter_volume_min(Distance_min_inter_volume);
565     double Volume_min = param->get_valeur((char*)"Volume_min");
566     DCR->change_volume_min(Volume_min);
567     double Aire_min = param->get_valeur((char*)"Aire_min");
568     DCR->change_aire_min(Aire_min);
569     double Longueur_min = param->get_valeur((char*)"Longueur_min");
570     DCR->change_longueur_min(Longueur_min);
571     double Angle_min = param->get_valeur((char*)"Angle_min");
572     DCR->change_angle_min(Angle_min);
573 couturad 966 long Nb_iteration_max = (long)param->get_valeur((char*)"Nb_iteration_max");
574 couturad 951 bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections");
575     DCR->change_intersection_bords_ves(Avec_intersections);
576     std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion");
577 couturad 971 char message[1000];
578     sprintf(message,"Generateur DCR : %s",Nom_groupe_inclusion.c_str());
579     affiche(message);
580 couturad 951 int Type_inclusion = param->get_valeur((char*)"Type_inclusion");
581     double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible");
582 ghazal 1190 double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique");
583 couturad 951 bool Porosite = (bool)param->get_valeur((char*)"Porosite");
584     std::string multicouche = param->get_nom((char*)"Multicouche");
585 ghazal 1190
586 couturad 960 bool Avec_interface_graphique = (bool)param->get_valeur((char*)"Avec_interface_graphique");
587     double Facteur_reduction_vitesse = param->get_valeur((char*)"Facteur_reduction_vitesse");
588     double Friction = param->get_valeur((char*)"Friction");
589     double Pas_temps_sim = param->get_valeur((char*)"Pas_temps_sim");
590     double Temps_max_sim = param->get_valeur((char*)"Temps_max_sim");
591 ghazal 1190 double Eps_vitesse = param->get_valeur((char*)"Eps_vitesse");
592 couturad 960 DCR->active_interface_graphique(Avec_interface_graphique);
593     DCR->change_facteur_reduction_vitesse(Facteur_reduction_vitesse);
594     DCR->change_eps_vitesse(Eps_vitesse);
595     DCR->change_friction(Friction);
596     DCR->change_pas_temps(Pas_temps_sim);
597     DCR->change_temps_max_sim(Temps_max_sim);
598 ghazal 1190
599 couturad 968 if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE)
600 couturad 951 {
601 couturad 966 double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
602     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
603     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
604 couturad 971 DCR->ajouter_spheres(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique,Porosite);
605 couturad 966 }
606 couturad 968 else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE)
607 couturad 966 {
608     double Mu_rayon = param->get_valeur((char*)"Mu_rayon");
609     double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon");
610     double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon");
611     double Mu_longueur = param->get_valeur((char*)"Mu_longueur");
612     double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur");
613     double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur");
614     double Mu_theta = param->get_valeur((char*)"Mu_theta");
615     double Sigma_theta = param->get_valeur((char*)"Sigma_theta");
616     double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta");
617     double Mu_phi = param->get_valeur((char*)"Mu_phi");
618     double Sigma_phi = param->get_valeur((char*)"Sigma_phi");
619     double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi");
620     DCR->ajouter_cylindres(Nom_groupe_inclusion,
621     Mu_rayon,Sigma_rayon,Type_distribution_rayon,
622     Mu_longueur,Sigma_longueur,Type_distribution_longueur,
623     Mu_theta,Sigma_theta,Type_distribution_theta,
624     Mu_phi,Sigma_phi,Type_distribution_phi,
625 couturad 971 Fraction_volumique_cible,Eps_fraction_volumique,
626     Porosite);
627 couturad 966 }
628 couturad 971 #else
629     std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl;
630 ghazal 1190 #endif
631 couturad 971 }
632     }
633     if(generateur->get_type()==MSTRUCT::TYPE_GENERATEUR::DCR)
634     {
635     #ifdef PROJECT_CHRONO
636     MSTRUCT_GENERATEUR_DCR *DCR= (MSTRUCT_GENERATEUR_DCR*)generateur;
637     if(DCR->lancer_simulation()==FAIL)
638 couturad 966 {
639     delete generateur;
640 couturad 971 return FAIL;
641 couturad 966 }
642 ghazal 1190 for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++)
643     {
644     OT_PARAMETRES* param = *it;
645     int changement = param->get_valeur((char*)"Changement_geometrie");
646     if(changement==0)
647 couturad 971 DCR->generer_geometrie();
648 ghazal 1190 if(changement==1)
649     DCR->generer_geometrie_avec_changement();
650    
651 couturad 952 #else
652     std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl;
653 ghazal 1190 #endif
654 couturad 919 }
655 ghazal 1190 }
656 couturad 919 ot_cpu.ajouter_etape((char*)"generation_geometrie");
657 couturad 926 double temps_generation_geometrie;
658     ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie);
659     change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie);
660 ghazal 1190 generateur->construire(this);
661 couturad 919 delete generateur;
662     return OK;
663     }
664    
665 couturad 926 int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau)
666 couturad 919 {
667     OT_CPU ot_cpu;
668     ot_cpu.initialise();
669     std::vector<OT_PARAMETRES*>::iterator it;
670     for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++)
671     {
672     OT_PARAMETRES* param = *it;
673     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
674 couturad 971 bool Etude_mecanique = (bool)param->get_valeur((char*)"Etude_mecanique");
675     if(Etude_mecanique)
676 couturad 919 {
677 couturad 971 double Mu_E = param->get_valeur((char*)"Mu_E");
678     double Sigma_E = param->get_valeur((char*)"Sigma_E");
679     int Type_distribution_E = (int)param->get_valeur((char*)"Type_distribution_E");
680     double Mu_nu = param->get_valeur((char*)"Mu_nu");
681     double Sigma_nu = param->get_valeur((char*)"Sigma_nu");
682     int Type_distribution_nu = (int)param->get_valeur((char*)"Type_distribution_nu");
683     std::random_device seed;
684 ghazal 1190 std::mt19937_64 generateur(seed());
685 couturad 971 std::uniform_real_distribution<double> uniform_distribution_E(Mu_E-Sigma_E,Mu_E+Sigma_E);
686     std::normal_distribution<double> normal_distribution_E(Mu_E,Sigma_E);
687     std::uniform_real_distribution<double> uniform_distribution_nu(Mu_nu-Sigma_nu,Mu_nu+Sigma_nu);
688 ghazal 1190 std::normal_distribution<double> normal_distribution_nu(Mu_nu,Sigma_nu);
689     MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
690 couturad 971 std::map<long,MG_CG_FORME*>::iterator it_forme;
691     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))
692 couturad 919 {
693 couturad 971 double E;
694     if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::FIXE) E=Mu_E;
695     else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) E=uniform_distribution_E(generateur);
696     else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) E=normal_distribution_E(generateur);
697     double nu;
698     if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::FIXE) nu=Mu_nu;
699     else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) nu=uniform_distribution_nu(generateur);
700 ghazal 1190 else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) nu=normal_distribution_nu(generateur);
701 couturad 971 if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
702     {
703     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
704     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",E);
705     forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu);
706     }
707     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
708     {
709     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
710     std::map<long,MG_VOLUME*>::iterator it_volume;
711     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))
712     {
713     volume->ajouter_ccf((char*)"Em",E);
714     volume->ajouter_ccf((char*)"nu",nu);
715     }
716     }
717 couturad 919 }
718 couturad 971 }
719     bool Etude_thermique = (bool)param->get_valeur((char*)"Etude_thermique");
720     if(Etude_thermique)
721     {
722     double Mu_Lambda = param->get_valeur((char*)"Mu_Lambda");
723     double Sigma_Lambda = param->get_valeur((char*)"Sigma_Lambda");
724     int Type_distribution_Lambda = (int)param->get_valeur((char*)"Type_distribution_Lambda");
725     double Mu_Ro = param->get_valeur((char*)"Mu_Ro");
726     double Sigma_Ro = param->get_valeur((char*)"Sigma_Ro");
727     int Type_distribution_Ro = (int)param->get_valeur((char*)"Type_distribution_Ro");
728     double Mu_Cp = param->get_valeur((char*)"Mu_Cp");
729     double Sigma_Cp = param->get_valeur((char*)"Sigma_Cp");
730     int Type_distribution_Cp = (int)param->get_valeur((char*)"Type_distribution_Cp");
731     std::random_device seed;
732 ghazal 1190 std::mt19937_64 generateur(seed());
733 couturad 971 std::uniform_real_distribution<double> uniform_distribution_Lambda(Mu_Lambda-Sigma_Lambda,Mu_Lambda+Sigma_Lambda);
734 ghazal 1190 std::normal_distribution<double> normal_distribution_Lambda(Mu_Lambda,Sigma_Lambda);
735 couturad 971 std::uniform_real_distribution<double> uniform_distribution_Ro(Mu_Ro-Sigma_Ro,Mu_Ro+Sigma_Ro);
736 ghazal 1190 std::normal_distribution<double> normal_distribution_Ro(Mu_Ro,Sigma_Ro);
737 couturad 971 std::uniform_real_distribution<double> uniform_distribution_Cp(Mu_Cp-Sigma_Cp,Mu_Cp+Sigma_Cp);
738     std::normal_distribution<double> normal_distribution_Cp(Mu_Cp,Sigma_Cp);
739 ghazal 1190 MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme);
740 couturad 971 std::map<long,MG_CG_FORME*>::iterator it_forme;
741     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))
742 couturad 919 {
743 couturad 971 double Lambda;
744     if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Lambda=Mu_Lambda;
745     else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Lambda=uniform_distribution_Lambda(generateur);
746     else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Lambda=normal_distribution_Lambda(generateur);
747     double Ro;
748     if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Ro=Mu_Ro;
749     else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Ro=uniform_distribution_Ro(generateur);
750     else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Ro=normal_distribution_Ro(generateur);
751     double Cp;
752     if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Cp=Mu_Cp;
753     else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Cp=uniform_distribution_Cp(generateur);
754 ghazal 1190 else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Cp=normal_distribution_Cp(generateur);
755 couturad 971 if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
756     {
757     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
758     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Kx",Lambda);
759     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Ro",Ro);
760     forme_volume->get_mg_volume()->ajouter_ccf((char*)"Cp",Cp);
761     }
762     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
763     {
764     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
765     std::map<long,MG_VOLUME*>::iterator it_volume;
766     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))
767     {
768     volume->ajouter_ccf((char*)"Kx",Lambda);
769     volume->ajouter_ccf((char*)"Ro",Ro);
770 ghazal 1190 volume->ajouter_ccf((char*)"Cp",Cp);
771 couturad 971 }
772     }
773 couturad 919 }
774     }
775 ghazal 1190 }
776 couturad 919 ot_cpu.ajouter_etape((char*)"generation_materiau");
777 couturad 926 double temps_generation_materiau;
778     ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau);
779     change_temps_materiau(get_temps_materiau()+temps_generation_materiau);
780 couturad 919 return OK;
781     }
782    
783 couturad 926 int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param)
784 couturad 919 {
785     double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal");
786 francois 1096 double Ecart_eps_face_particule = param->get_valeur((char*)"Ecart_eps_face_particule");
787 couturad 919 double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage");
788     double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction");
789     std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution");
790     std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte");
791     std::string Nom_carte = param->get_nom((char*)"Nom_carte");
792     double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min");
793     double Nb_pas = param->get_valeur((char*)"Nb_pas");
794     double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation");
795     MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE;
796 couturad 926 MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice");
797     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume();
798 couturad 919 OT_CPU ot_cpu;
799     ot_cpu.initialise();
800     FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte,
801     m_mg_geometrie,
802     Ecart_nodal,
803 francois 1096 Ecart_eps_face_particule,
804 couturad 919 Fechantillonnage,
805     Nb_cellule_direction,
806     (char*)Nom_fem_solution.c_str(),
807     tpl_map_volume_matrice,
808     Nb_couche_min,
809     Nb_pas,
810     Facteur_augmentation);
811 ghazal 1190
812    
813 couturad 933 carte->active_affichage(fonc_affiche);
814 couturad 926 carte->construit();
815 couturad 919 ot_cpu.ajouter_etape((char*)"generation_carte");
816 couturad 926 double temps_generation_carte;
817     ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte);
818 ghazal 1190 change_temps_carte(get_temps_carte()+temps_generation_carte);
819     mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str());
820 couturad 919 carte->enregistrer((char*)Nom_carte.c_str());
821 couturad 964 char message[1000];
822     std::sprintf(message,"Fichier CARTE de sortie : %s",Nom_carte.c_str());
823     affiche(message);
824 couturad 926 m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str());
825 couturad 919 return OK;
826     }
827    
828 couturad 926 int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte)
829 couturad 919 {
830     OT_CPU ot_cpu;
831     ot_cpu.initialise();
832     int Niveau = (int)param->get_valeur((char*)"Niveau");
833     int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d");
834     int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d");
835     double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique");
836 couturad 1029 int Analyse = (int)param->get_valeur((char*)"Analyse");
837     int Grille_reguliere = (int)param->get_valeur((char*)"Grille_reguliere");
838     int Gr_nx = param->get_valeur((char*)"Gr_nx");
839     int Gr_ny = param->get_valeur((char*)"Gr_ny");
840     int Gr_nz = param->get_valeur((char*)"Gr_nz");
841 ghazal 1190 affiche((char*)"Maillage du VER :");
842 couturad 1029 if(!Grille_reguliere)
843 couturad 919 {
844 couturad 1029 m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie);
845     m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage);
846 ghazal 1190 change_mg_maillage(m_mg_maillage);
847 couturad 1029 affiche((char*)"Maillage 3D_couche :");
848     MAILLEUR3D_COUCHE m3d_couche(m_mg_maillage,m_mg_geometrie,carte);
849 ghazal 1190 m3d_couche.active_affichage(fonc_affiche);
850 couturad 1029 LISTE_MG_VOLUME::iterator it_volume;
851     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
852 couturad 951 {
853 couturad 1029 if(volume->est_mince())
854     {
855     char message[1000];
856     sprintf(message,"-> Maillage du volume id %li",volume->get_id());
857     affiche(message);
858     if(m3d_couche.maille(volume)==FAIL) return FAIL;
859     }
860 couturad 951 }
861 couturad 1029 if(Niveau>=0)
862 couturad 951 {
863 couturad 1029 long i=1;
864     long nb=m_mg_geometrie->get_nb_mg_sommet();
865     MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie);
866     affiche((char*)"Maillage 0D :");
867     LISTE_MG_SOMMET::iterator it_sommet;
868     for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet))
869     {
870     if(sommet->get_lien_maillage()->get_nb()>0) continue;
871     char message[1000];
872     sprintf(message,"[%4li/%li] Maillage du sommet id %li",i,nb,sommet->get_id());
873     affiche(message);
874     if(m0d.maille(sommet)==FAIL) return FAIL;
875     i++;
876     }
877 couturad 951 }
878 couturad 1029 if(Niveau>=1)
879 couturad 951 {
880 couturad 1029 long i=1;
881     long nb=m_mg_geometrie->get_nb_mg_arete();
882     MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte);
883     affiche((char*)"Maillage 1D :");
884 ghazal 1190 m1d.active_affichage(fonc_affiche);
885 couturad 1029 LISTE_MG_ARETE::iterator it_arete;
886     for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete))
887     {
888     if(arete->get_lien_maillage()->get_nb()>0) continue;
889     char message[1000];
890     sprintf(message,"[%4li/%li] Maillage de l'arete id %li",i,nb,arete->get_id());
891     affiche(message);
892     if(m1d.maille(arete)==FAIL) return FAIL;
893     i++;
894     }
895 couturad 951 }
896 couturad 1029 if(Niveau>=2)
897 couturad 951 {
898 couturad 1029 long i=1;
899     long nb=m_mg_geometrie->get_nb_mg_face();
900     MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte);
901     m2d.change_niveau_optimisation(Niveau_opt_2d);
902     m2d.change_priorite_metrique(Priorite_metrique);
903     affiche((char*)"Maillage 2D :");
904     m2d.active_affichage(fonc_affiche);
905     LISTE_MG_FACE::iterator it_face;
906     for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
907     {
908     if(face->get_lien_maillage()->get_nb()>0) continue;
909     char message[1000];
910     sprintf(message,"[%4li/%li] Maillage de la face id %li",i,nb,face->get_id());
911     affiche(message);
912     if(m2d.maille(face)==FAIL) return FAIL;
913     i++;
914     }
915 couturad 951 }
916 couturad 1029 if(Niveau>=3)
917 couturad 951 {
918 couturad 1029 long i=1;
919     long nb=m_mg_geometrie->get_nb_mg_volume();
920     MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false);
921     m3d.change_niveau_optimisation(Niveau_opt_3d);
922     m3d.change_priorite_metrique(Priorite_metrique);
923     affiche((char*)"Maillage 3D :");
924     m3d.active_affichage(fonc_affiche);
925     for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume))
926     {
927     if(volume->get_lien_maillage()->get_nb()>0) continue;
928     if(volume->est_mince()) continue;
929     char message[1000];
930     sprintf(message,"[%4li/%li] Maillage du volume id %li",i,nb,volume->get_id());
931     affiche(message);
932     if(m3d.maille(volume)==FAIL) return FAIL;
933     i++;
934     }
935 couturad 951 }
936     }
937 couturad 1029 else
938     {
939     maill_struct(0.0,1.0,0.0,1.0,0.0,1.0,Gr_nx,Gr_ny,Gr_nz);
940     m_mg_maillage=m_mg_gestionnaire->get_mg_maillage(m_mg_gestionnaire->get_nb_mg_maillage()-1);
941     change_mg_maillage(m_mg_maillage);
942     LISTE_MG_HEXA::iterator it_hexa;
943     TPL_GRILLE<MG_HEXA*> tpl_grille_hexa;
944 ghazal 1190 tpl_grille_hexa.initialiser(-0.1,-0.1,-0.1,1.1,1.1,1.1,20,20,20);
945     for(MG_HEXA* hexa=m_mg_maillage->get_premier_hexa(it_hexa);hexa!=NULL;hexa=m_mg_maillage->get_suivant_hexa(it_hexa))
946 couturad 1029 {
947     tpl_grille_hexa.inserer(hexa);
948     hexa->change_nouveau_numero(-1);
949     }
950     long i_volume=0;
951     long nb_volume=m_mg_geometrie->get_nb_mg_volume();
952     LISTE_MG_VOLUME::iterator it_volume;
953     for(MG_VOLUME*vol=m_mg_geometrie->get_premier_volume(it_volume);vol!=NULL;vol=m_mg_geometrie->get_suivant_volume(it_volume))
954     {
955     TPL_MAP_ENTITE<MG_HEXA*> hexa_trouve;
956     tpl_grille_hexa.rechercher(vol->get_boite_3D(),hexa_trouve);
957     for(MG_HEXA* hexa=hexa_trouve.get_premier(it_hexa);hexa!=NULL;hexa=hexa_trouve.get_suivant(it_hexa))
958     {
959     if(hexa->get_nouveau_numero()<0)
960     {
961     BOITE_3D boite3d=hexa->get_boite_3D();
962     double xyz[3];
963     boite3d.get_centre(xyz);
964     if(OT_GEOMETRIE::est_dans_mg_volume(xyz,vol)==1)
965     {
966     hexa->change_lien_topologie2(vol);
967     vol->get_lien_maillage()->ajouter(hexa);
968     hexa->change_nouveau_numero(vol->get_id());
969     }
970     }
971     }
972     i_volume++;
973     std::cout << i_volume << "/" << nb_volume << std::endl;
974     }
975 ghazal 1190
976    
977    
978    
979    
980    
981    
982 couturad 1029 }
983 couturad 919 ot_cpu.ajouter_etape((char*)"generation_maillage");
984 couturad 926 double temps_generation_maillage;
985     ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage);
986     change_temps_maillage(get_temps_maillage()+temps_generation_maillage);
987 couturad 919 return OK;
988     }
989    
990 couturad 1029 int MSTRUCT_VES::maill_struct(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int n, int m, int k)
991     {
992 ghazal 1190
993 couturad 1029 affiche((char*)"Création d'un maillage MG structuré");
994     double intx, inty, intz;
995     std::vector<double> tabx,taby,tabz;
996    
997     intx=fabs(xmax-xmin)/n;
998     inty=fabs(ymax-ymin)/m;
999     intz=fabs(zmax-zmin)/k;
1000    
1001    
1002 ghazal 1190
1003 couturad 1029 MG_GEOMETRIE* geo= m_mg_geometrie;
1004 ghazal 1190
1005 couturad 1029 MG_MAILLAGE* mai=new MG_MAILLAGE(geo);
1006 ghazal 1190 m_mg_gestionnaire->ajouter_mg_maillage(mai);
1007 couturad 1029 std::vector<MG_NOEUD*> vecnod;
1008 ghazal 1190 for (int l=0; l<=k ;l++)
1009 couturad 1029 {
1010     for (int j=0; j<=m;j++)
1011     {
1012     for (int i=0; i<=n;i++)
1013 ghazal 1190 {
1014 couturad 1029 MG_ELEMENT_TOPOLOGIQUE *topo=NULL;
1015    
1016     double x,y,z;
1017 ghazal 1190
1018 couturad 1029 z=zmin+(l*intz);
1019     y=ymin+(j*inty);
1020     x=xmin+(i*intx);
1021    
1022 ghazal 1190
1023 couturad 1029 MG_NOEUD* nou=mai->ajouter_mg_noeud(topo,x,y,z,MAGIC::ORIGINE::MAILLEUR_AUTO);
1024     vecnod.push_back(nou);
1025     }
1026     }
1027     }
1028     for(int l=0; l<k;l++)
1029 ghazal 1190 {
1030 couturad 1029 for(int j=0; j<m;j++)
1031 ghazal 1190 {
1032 couturad 1029 for(int i=0; i<n;i++)
1033     {
1034     MG_NOEUD* nod1=vecnod[i+((n+1)*j)+(l*(m+1)*(n+1))];
1035 ghazal 1190 MG_NOEUD* nod2=vecnod[(i+1)+((n+1)*j)+(l*(m+1)*(n+1))];
1036 couturad 1029 MG_NOEUD* nod3=vecnod[(i+1)+(n+1)*(j+1)+(l*(m+1)*(n+1))];
1037     MG_NOEUD* nod4=vecnod[i+(n+1)*(j+1)+(l*(m+1)*(n+1))];
1038 ghazal 1190 MG_NOEUD* nod5=vecnod[i+((n+1)*j)+((l+1)*(m+1)*(n+1))];
1039 couturad 1029 MG_NOEUD* nod6=vecnod[(i+1)+((n+1)*j)+((l+1)*(m+1)*(n+1))];
1040     MG_NOEUD* nod7=vecnod[(i+1)+(n+1)*(j+1)+((l+1)*(m+1)*(n+1))];
1041     MG_NOEUD* nod8=vecnod[i+(n+1)*(j+1)+((l+1)*(m+1)*(n+1))];
1042     MG_HEXA *hexa=mai->ajouter_mg_hexa(NULL,nod1,nod2,nod3,nod4,nod5,nod6,nod7,nod8,MAGIC::ORIGINE::MAILLEUR_AUTO);
1043     }
1044     }
1045 ghazal 1190 }
1046 couturad 1029 /*affiche((char*)"Création d'un maillage FEM structuré");
1047     FEM_MAILLAGE* fem = new FEM_MAILLAGE(geo, mai,1);
1048     gest->ajouter_fem_maillage(fem);
1049     fem->construire();*/
1050     return OK;
1051     }
1052    
1053    
1054 couturad 926 int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param)
1055 couturad 919 {
1056     OT_CPU ot_cpu;
1057     ot_cpu.initialise();
1058     int Degre = (int)param->get_valeur((char*)"Degre");
1059     int Analyse = (int)param->get_valeur((char*)"Analyse");
1060     int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud");
1061 ghazal 1190 int decoup=(int)param->get_valeur((char*)"Avec_decoup");
1062     bool courbure_discrete;
1063     if(decoup==0) courbure_discrete=false;
1064     if(decoup==1) courbure_discrete=true;
1065 couturad 919 MAILLEUR_FEM mailleurfem;
1066     mailleurfem.active_affichage(fonc_affiche);
1067 couturad 926 m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre);
1068 couturad 919 m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage);
1069 ghazal 1190 change_fem_maillage(m_fem_maillage);
1070     if(Optimisation_num_noeud) {if(mailleurfem.maille(m_fem_maillage,courbure_discrete,1)==FAIL) return FAIL;}
1071     else {if(mailleurfem.maille(m_fem_maillage,courbure_discrete,0)==FAIL) return FAIL;};
1072     if(Analyse)
1073 couturad 919 {
1074     MAILLEUR_ANALYSE m3d(m_fem_maillage);
1075     m3d.active_affichage(fonc_affiche);
1076     }
1077     ot_cpu.ajouter_etape((char*)"generation_fem_maillage");
1078 couturad 926 double temps_generation_fem_maillage;
1079     ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage);
1080     change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage);
1081 couturad 919 return OK;
1082     }
1083    
1084 couturad 926 int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param)
1085 couturad 919 {
1086     OT_CPU ot_cpu;
1087     ot_cpu.initialise();
1088 couturad 926 BOITE_3D boite3D_ves = get_boite3d_ves();
1089     double eps = get_precision();
1090 couturad 982 int Type_etude = (int)param->get_valeur((char*)"Type_etude");
1091     int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement");
1092     int Type_CL = (int)param->get_valeur((char*)"Type_CL");
1093     double Valeur_CL = param->get_valeur((char*)"Valeur_CL");
1094     int Direction = (int)param->get_valeur((char*)"Direction");
1095     MSTRUCT_OUTILS::appliquer_conditions_limites(m_mg_geometrie,boite3D_ves,Type_etude,Type_CL,Type_Chargement,Valeur_CL,Direction,eps);
1096 couturad 919 ot_cpu.ajouter_etape((char*)"generation_etude");
1097 couturad 926 double temps_generation_etude;
1098     ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude);
1099     change_temps_etude(get_temps_etude()+temps_generation_etude);
1100 couturad 919 return OK;
1101     }
1102    
1103 couturad 968 int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster,std::string nom_etude)
1104 couturad 919 {
1105     int Type_etude = (int)param->get_valeur((char*)"Type_etude");
1106 couturad 971 int Type_calcul;
1107     if(Type_etude==MSTRUCT::TYPE_ETUDE::MECANIQUE) Type_calcul=MAGIC::CALCUL_ASTER::ELASTIQUE;
1108     else if(Type_etude==MSTRUCT::TYPE_ETUDE::THERMIQUE) Type_calcul=MAGIC::CALCUL_ASTER::THERMIQUE;
1109 ghazal 1190 std::string Code_resu = param->get_nom((char*)"Code_resu");
1110 couturad 919 MGASTER mgaster;
1111     mgaster.active_affichage(fonc_affiche);
1112     OT_CPU ot_cpu;
1113     ot_cpu.initialise();
1114 couturad 968 mgaster.calcule(param_aster,m_fem_maillage,(char*)nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str());
1115 couturad 919 ot_cpu.ajouter_etape((char*)"calcul");
1116 couturad 926 double temps_calcul;
1117     ot_cpu.get_etape((char*)"calcul",temps_calcul);
1118     change_temps_calcul(get_temps_calcul()+temps_calcul);
1119 francois 1075 return 0;
1120 ghazal 1190
1121 couturad 919 }
1122    
1123 couturad 968 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement)
1124 couturad 919 {
1125 couturad 926 OT_CPU ot_cpu;
1126     ot_cpu.initialise();
1127     std::vector<OT_PARAMETRES*>::iterator it;
1128 couturad 968 char ligne[1000];
1129     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
1130 couturad 919 {
1131 couturad 926 OT_PARAMETRES* param = *it;
1132 couturad 968 int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
1133 couturad 926 std::string Identifiant = param->get_nom((char*)"Identifiant");
1134     if(get_analyse(Identifiant)!=NULL)
1135     {
1136     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
1137     continue;
1138     }
1139     sprintf(ligne,"-> %s",Identifiant.c_str());
1140     affiche(ligne);
1141 couturad 968 if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP)
1142 couturad 926 {
1143     long Num_solution = (long)param->get_valeur((char*)"Num_solution");
1144 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1145     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1146     BOITE_3D *boite_3d_analyse=NULL;
1147     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1148     if(Boite_analyse)
1149     {
1150     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1151     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1152     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1153     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1154     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1155     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1156     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1157     }
1158 ghazal 1190 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1159 couturad 926 FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution);
1160     int nb_champ = sol->get_nb_champ();
1161 couturad 968 MSTRUCT_ANALYSE_CHAMP* analyse_champ = new MSTRUCT_ANALYSE_CHAMP(this,Identifiant,sol->get_id(),nb_champ,Largeur_colonne_distribution,Nom_groupe_forme,boite_3d_analyse);
1162     if(Analyse_erosion)
1163 couturad 930 {
1164 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1165     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1166     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_champ,Nb_couche,Epaisseur_couche);
1167     analyse_erosion->executer();
1168     ajouter_analyse(analyse_erosion);
1169 couturad 930 }
1170     else
1171     {
1172 couturad 968 analyse_champ->executer();
1173     ajouter_analyse(analyse_champ);
1174 couturad 930 }
1175 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1176 couturad 968 }
1177     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION)
1178 couturad 926 {
1179 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1180     int Avec_fem_maillage = (int)param->get_valeur((char*)"Avec_fem_maillage");
1181     BOITE_3D *boite_3d_analyse=NULL;
1182     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1183     if(Boite_analyse)
1184 couturad 930 {
1185 couturad 968 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1186     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1187     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1188     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1189     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1190     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1191     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1192 couturad 930 }
1193 couturad 968 MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(this,Identifiant,Nom_groupe_forme,boite_3d_analyse,Avec_fem_maillage);
1194 ghazal 1190 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1195 couturad 968 if(Analyse_erosion)
1196 couturad 930 {
1197 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1198     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1199     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_orientation,Nb_couche,Epaisseur_couche);
1200     analyse_erosion->executer();
1201     ajouter_analyse(analyse_erosion);
1202 couturad 930 }
1203 couturad 938 else
1204     {
1205 couturad 968 analyse_orientation->executer();
1206     ajouter_analyse(analyse_orientation);
1207 couturad 938 }
1208 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1209 couturad 938 }
1210 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CAO)
1211 couturad 926 {
1212 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1213 couturad 926 double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme");
1214 couturad 968 MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(this,Identifiant,Largeur_colonne_distribution_volume_forme,Nom_groupe_forme);
1215     analyse_cao->executer();
1216 ghazal 1190 ajouter_analyse(analyse_cao);
1217 couturad 926 }
1218 couturad 971 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_PROPRIETE_MASSIQUE)
1219     {
1220     std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1221     MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE* analyse_prop_mass = new MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE(this,Identifiant,Nom_groupe_forme);
1222     analyse_prop_mass->executer();
1223 ghazal 1190 ajouter_analyse(analyse_prop_mass);
1224 couturad 971 }
1225 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_MG)
1226 couturad 926 {
1227 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1228 couturad 926 double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D");
1229     double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D");
1230     double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D");
1231     double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D");
1232 couturad 968 BOITE_3D *boite_3d_analyse=NULL;
1233     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1234     if(Boite_analyse)
1235 couturad 930 {
1236 couturad 968 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1237     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1238     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1239     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1240     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1241     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1242     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1243 couturad 930 }
1244 couturad 968 MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(this,
1245     Identifiant,
1246     m_mg_maillage->get_id(),
1247     Largeur_colonne_distribution_qualite_2D,
1248     Largeur_colonne_distribution_taille_2D,
1249     Largeur_colonne_distribution_qualite_3D,
1250     Largeur_colonne_distribution_taille_3D,
1251     Nom_groupe_forme,boite_3d_analyse);
1252 ghazal 1190 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1253 couturad 968 if(Analyse_erosion)
1254     {
1255     long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1256     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1257     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_mg_maillage,Nb_couche,Epaisseur_couche);
1258     analyse_erosion->executer();
1259     ajouter_analyse(analyse_erosion);
1260     }
1261 couturad 930 else
1262     {
1263 couturad 968 analyse_mg_maillage->executer();
1264     ajouter_analyse(analyse_mg_maillage);
1265 couturad 930 }
1266 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1267 couturad 926 }
1268 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_FEM)
1269 couturad 926 {
1270 couturad 968 std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme");
1271 couturad 926 double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min");
1272     double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max");
1273     double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min");
1274     double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max");
1275     double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D");
1276     double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D");
1277 couturad 968 BOITE_3D *boite_3d_analyse=NULL;
1278     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1279     if(Boite_analyse)
1280     {
1281     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1282     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1283     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1284     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1285     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1286     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1287     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1288     }
1289     MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(this,
1290     Identifiant,
1291 couturad 926 m_fem_maillage->get_id(),
1292     Largeur_colonne_distribution_jacobien_2D_min,
1293     Largeur_colonne_distribution_jacobien_2D_max,
1294     Largeur_colonne_distribution_jacobien_3D_min,
1295     Largeur_colonne_distribution_jacobien_3D_max,
1296     Largeur_colonne_distribution_distortion_2D,
1297     Largeur_colonne_distribution_distortion_3D,
1298     Nom_groupe_forme,
1299     boite_3d_analyse);
1300 ghazal 1190 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1301 couturad 968 if(Analyse_erosion)
1302 couturad 930 {
1303 couturad 968 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1304     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1305     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_maillage_fem,Nb_couche,Epaisseur_couche);
1306     analyse_erosion->executer();
1307     ajouter_analyse(analyse_erosion);
1308 couturad 930 }
1309     else
1310     {
1311 couturad 968 analyse_maillage_fem->executer();
1312     ajouter_analyse(analyse_maillage_fem);
1313 couturad 930 }
1314 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1315 couturad 926 }
1316 couturad 968 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_NORMALISE)
1317     {
1318     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1319 couturad 982 std::string Identifiant_champ_reference = param->get_nom((char*)"Identifiant_champ_reference");
1320 couturad 968 double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1321     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1322     {
1323     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1324 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ_reference);
1325     double valeur_ref=0.0;
1326     int nb_champ=analyse_champ_reference->get_nb_champ();
1327 couturad 997 for(int i=0;i<nb_champ;i++)
1328     {
1329     valeur_ref+=analyse_champ_reference->get_moyenne()[i]*analyse_champ_reference->get_moyenne()[i];
1330     }
1331     valeur_ref=sqrt(valeur_ref);
1332 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution);
1333 couturad 968 ajouter_analyse(analyse_normalise);
1334     }
1335     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1336     {
1337     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1338     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1339     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1340     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1341     MSTRUCT_ANALYSE_EROSION* analyse_erosion_normalise = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1342     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1343 couturad 982 int k=0;
1344     double valeur_ref=0.0;
1345 couturad 968 for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1346     {
1347 couturad 982 if(k==0)
1348     {
1349     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion_reference;
1350     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ_reference = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ_reference);
1351     MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_champ_reference->get_premiere_analyse(it_analyse_erosion_reference);
1352     int nb_champ=analyse_champ_reference->get_nb_champ();
1353 couturad 1000 for(int i=0;i<nb_champ;i++)
1354     {
1355     valeur_ref+=analyse_champ_reference->get_moyenne()[i]*analyse_champ_reference->get_moyenne()[i];
1356     }
1357     valeur_ref=sqrt(valeur_ref);
1358 couturad 982 }
1359 couturad 968 MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1360 couturad 982 MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution);
1361 couturad 968 analyse_erosion_normalise->ajouter_analyse(analyse_normalise);
1362 couturad 982 k++;
1363 couturad 968 }
1364     ajouter_analyse(analyse_erosion_normalise);
1365 ghazal 1190 }
1366 couturad 968 }
1367     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART)
1368     {
1369     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1370     if(get_analyse(Identifiant_champ)==NULL)
1371     {
1372     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1373     return FAIL;
1374     }
1375     std::string Identifiant_champ_compare = param->get_nom((char*)"Identifiant_champ_compare");
1376     if(get_analyse(Identifiant_champ_compare)==NULL)
1377     {
1378     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1379     return FAIL;
1380     }
1381     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1382     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1383     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1384     {
1385     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1386     MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare);
1387     if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1388     {
1389     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare;
1390     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1391 ghazal 1190 ajouter_analyse(analyse_ecart);
1392 couturad 968 }
1393     else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1394     {
1395     MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare;
1396     int Num_couche = (int)param->get_valeur((char*)"Num_couche");
1397     if(Num_couche>=0)
1398     {
1399     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche);
1400     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1401     ajouter_analyse(analyse_ecart);
1402     }
1403     else
1404     {
1405     double epaisseur_couche = analyse_erosion_compare->get_epaisseur_couche();
1406     std::string Nom_groupe_forme = analyse_erosion_compare->get_nom_groupe_forme();
1407     BOITE_3D *boite_3d_analyse=analyse_erosion_compare->get_boite_analyse();
1408     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1409     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1410     for(MSTRUCT_ANALYSE* analyse_champ_compare=analyse_erosion_compare->get_premiere_analyse(it_analyse_erosion);analyse_champ_compare!=NULL;analyse_champ_compare=analyse_erosion_compare->get_suivante_analyse(it_analyse_erosion))
1411     {
1412     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,(MSTRUCT_ANALYSE_CHAMP*)analyse_champ_compare,Type_ecart);
1413     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1414     }
1415     ajouter_analyse(analyse_erosion_ecart);
1416     }
1417 ghazal 1190
1418 couturad 968 }
1419     }
1420     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1421     {
1422     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1423     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1424     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1425     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1426     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1427     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1428     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1429     {
1430     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1431     MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare);
1432     if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1433     {
1434     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare;
1435     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1436     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1437     }
1438     else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1439     {
1440     MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare;
1441     int Num_couche = (int)param->get_valeur((char*)"Num_couche");
1442     if(Num_couche>=0)
1443     {
1444     MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche);
1445     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart);
1446     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1447     }
1448     else
1449     {
1450 ghazal 1190
1451 couturad 968 }
1452 ghazal 1190
1453 couturad 968 }
1454     }
1455     ajouter_analyse(analyse_erosion_ecart);
1456     }
1457     }
1458     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART_CHARGEMENT)
1459     {
1460     std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ");
1461     if(get_analyse(Identifiant_champ)==NULL)
1462     {
1463     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1464     return FAIL;
1465     }
1466     double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution");
1467     int Type_chargement = (int)param->get_valeur((char*)"Type_chargement");
1468     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1469     if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1470     {
1471     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ);
1472     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart);
1473     ajouter_analyse(analyse_ecart);
1474     }
1475     else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1476     {
1477     MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ);
1478     double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche();
1479     std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme();
1480     BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse();
1481     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1482     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1483     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_champ->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_champ->get_suivante_analyse(it_analyse_erosion))
1484     {
1485     MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse;
1486     MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart);
1487     analyse_erosion_ecart->ajouter_analyse(analyse_ecart);
1488     }
1489     ajouter_analyse(analyse_erosion_ecart);
1490     }
1491     }
1492     else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION_ECART)
1493     {
1494     std::string Identifiant_orientation = param->get_nom((char*)"Identifiant_orientation");
1495     if(get_analyse(Identifiant_orientation)==NULL)
1496     {
1497     std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl;
1498     return FAIL;
1499     }
1500     int Type_ecart = (int)param->get_valeur((char*)"Type_ecart");
1501     double tenseur_compare[6];
1502     tenseur_compare[0] = (double)param->get_valeur((char*)"a_11");
1503     tenseur_compare[1] = (double)param->get_valeur((char*)"a_22");
1504     tenseur_compare[2] = (double)param->get_valeur((char*)"a_33");
1505     tenseur_compare[3] = (double)param->get_valeur((char*)"a_12");
1506     tenseur_compare[4] = (double)param->get_valeur((char*)"a_23");
1507     tenseur_compare[5] = (double)param->get_valeur((char*)"a_13");
1508     if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::ORIENTATION)
1509     {
1510     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)get_analyse(Identifiant_orientation);
1511 ghazal 1190 MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart);
1512 couturad 968 ajouter_analyse(analyse_compare);
1513     }
1514     else if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1515     {
1516     MSTRUCT_ANALYSE_EROSION* analyse_erosion_orientation = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_orientation);
1517     double epaisseur_couche = analyse_erosion_orientation->get_epaisseur_couche();
1518     std::string Nom_groupe_forme = analyse_erosion_orientation->get_nom_groupe_forme();
1519     BOITE_3D *boite_3d_analyse=analyse_erosion_orientation->get_boite_analyse();
1520     MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1521     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion;
1522     for(MSTRUCT_ANALYSE* analyse=analyse_erosion_orientation->get_premiere_analyse(it_analyse_erosion);analyse!=NULL;analyse=analyse_erosion_orientation->get_suivante_analyse(it_analyse_erosion))
1523     {
1524     MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)analyse;
1525 ghazal 1190 MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart);
1526 couturad 968 analyse_erosion_ecart->ajouter_analyse(analyse_compare);
1527     }
1528     ajouter_analyse(analyse_erosion_ecart);
1529     }
1530     }
1531 couturad 971 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE)
1532     {
1533 couturad 982 long Num_solution_temp=(long)param->get_valeur((char*)"Num_solution_temp");
1534     long Num_solution_flux=(long)param->get_valeur((char*)"Num_solution_flux");
1535     int Direction=(int)param->get_valeur((char*)"Direction");
1536     BOITE_3D *boite_3d_analyse=NULL;
1537     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1538     if(Boite_analyse)
1539 couturad 971 {
1540 couturad 982 double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1541     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1542     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1543     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1544     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1545     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1546     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1547 couturad 971 }
1548 couturad 982 int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1549     FEM_SOLUTION * fem_sol_temp=get_mg_gestionnaire()->get_fem_solution(Num_solution_temp);
1550     FEM_SOLUTION * fem_sol_flux=get_mg_gestionnaire()->get_fem_solution(Num_solution_flux);
1551     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_cond_ther = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(this,Identifiant,fem_sol_temp->get_id(),fem_sol_flux->get_id(),Direction,boite_3d_analyse);
1552     if(Analyse_erosion)
1553 couturad 971 {
1554 couturad 982 long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1555     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1556     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_cond_ther,Nb_couche,Epaisseur_couche);
1557     analyse_erosion->executer();
1558     ajouter_analyse(analyse_erosion);
1559 couturad 971 }
1560     else
1561     {
1562 couturad 982 analyse_cond_ther->executer();
1563     ajouter_analyse(analyse_cond_ther);
1564 couturad 971 }
1565 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1566 couturad 971 }
1567 couturad 1029 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ENERGIE_HILL)
1568     {
1569     long Num_solution_temp=(long)param->get_valeur((char*)"Num_solution_epsilon");
1570     long Num_solution_flux=(long)param->get_valeur((char*)"Num_solution_sigma");
1571     BOITE_3D *boite_3d_analyse=NULL;
1572     int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse");
1573     if(Boite_analyse)
1574     {
1575     double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin");
1576     double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin");
1577     double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin");
1578     double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax");
1579     double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax");
1580     double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax");
1581     boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
1582     }
1583     int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion");
1584     FEM_SOLUTION * fem_sol_temp=get_mg_gestionnaire()->get_fem_solution(Num_solution_temp);
1585     FEM_SOLUTION * fem_sol_flux=get_mg_gestionnaire()->get_fem_solution(Num_solution_flux);
1586     MSTRUCT_ANALYSE_ENERGIE_HILL* analyse_cond_ther = new MSTRUCT_ANALYSE_ENERGIE_HILL(this,Identifiant,fem_sol_temp->get_id(),fem_sol_flux->get_id(),boite_3d_analyse);
1587     if(Analyse_erosion)
1588     {
1589     long Nb_couche = (long)param->get_valeur((char*)"Nb_couche");
1590     double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche");
1591     MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_cond_ther,Nb_couche,Epaisseur_couche);
1592     analyse_erosion->executer();
1593     ajouter_analyse(analyse_erosion);
1594     }
1595     else
1596     {
1597     analyse_cond_ther->executer();
1598     ajouter_analyse(analyse_cond_ther);
1599     }
1600 ghazal 1190 if(boite_3d_analyse!=NULL) delete boite_3d_analyse;
1601 couturad 1029 }
1602 couturad 993 else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_TEMPS)
1603     {
1604 ghazal 1190
1605 couturad 993 }
1606 couturad 968 else
1607     {
1608     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1609     affiche(ligne);
1610     }
1611 couturad 919 }
1612 couturad 926 ot_cpu.ajouter_etape((char*)"analyse");
1613     double temps_analyse;
1614     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1615     change_temps_analyse(get_temps_analyse()+temps_analyse);
1616 francois 1075 return 0;
1617 couturad 919 }
1618    
1619 couturad 968 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement,
1620     MSTRUCT_VES_FILE* ves_sph,
1621     MSTRUCT_VES_FILE* ves_dev)
1622 couturad 933 {
1623 couturad 968 OT_CPU ot_cpu;
1624     ot_cpu.initialise();
1625     std::vector<OT_PARAMETRES*>::iterator it;
1626     char ligne[1000];
1627     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
1628     {
1629     OT_PARAMETRES* param = *it;
1630     int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
1631     std::string Identifiant = param->get_nom((char*)"Identifiant");
1632     if(get_analyse(Identifiant)!=NULL)
1633     {
1634     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
1635     return FAIL;
1636     }
1637     sprintf(ligne,"-> %s",Identifiant.c_str());
1638     affiche(ligne);
1639     if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MODULES_ELASTICITE)
1640     {
1641     std::string Identifiant_epsilon = param->get_nom((char*)"Identifiant_epsilon");
1642     std::string Identifiant_sigma = param->get_nom((char*)"Identifiant_sigma");
1643     if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP)
1644     {
1645     MSTRUCT_ANALYSE_CHAMP* epsilon_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_epsilon);
1646     MSTRUCT_ANALYSE_CHAMP* sigma_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_sigma);
1647     MSTRUCT_ANALYSE_CHAMP* epsilon_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_epsilon);
1648     MSTRUCT_ANALYSE_CHAMP* sigma_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_sigma);
1649     MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant,epsilon_sph,sigma_sph,epsilon_dev,sigma_dev);
1650     analyse_modules_elasticite->executer();
1651     ajouter_analyse(analyse_modules_elasticite);
1652     }
1653     else if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1654     {
1655     MSTRUCT_ANALYSE_EROSION* epsilon_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_epsilon);
1656     MSTRUCT_ANALYSE_EROSION* sigma_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_sigma);
1657     MSTRUCT_ANALYSE_EROSION* epsilon_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_epsilon);
1658 ghazal 1190 MSTRUCT_ANALYSE_EROSION* sigma_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_sigma);
1659 couturad 968 long Nb_couche = epsilon_sph_erosion->get_nb_analyse();
1660     double Epaisseur_couche = epsilon_sph_erosion->get_epaisseur_couche();
1661     std::string Nom_groupe_forme = epsilon_sph_erosion->get_nom_groupe_forme();
1662     BOITE_3D *boite_3d_analyse=epsilon_sph_erosion->get_boite_analyse();
1663     MSTRUCT_ANALYSE_EROSION* analyse_modules_elasticite_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,Epaisseur_couche,Nom_groupe_forme,boite_3d_analyse);
1664     for(int i=0;i<Nb_couche;i++)
1665     {
1666     MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant,
1667     (MSTRUCT_ANALYSE_CHAMP*)epsilon_sph_erosion->get_analyse(i),
1668     (MSTRUCT_ANALYSE_CHAMP*)sigma_sph_erosion->get_analyse(i),
1669     (MSTRUCT_ANALYSE_CHAMP*)epsilon_dev_erosion->get_analyse(i),
1670     (MSTRUCT_ANALYSE_CHAMP*)sigma_dev_erosion->get_analyse(i));
1671     analyse_modules_elasticite->executer();
1672     analyse_modules_elasticite_erosion->ajouter_analyse(analyse_modules_elasticite);
1673     }
1674     ajouter_analyse(analyse_modules_elasticite_erosion);
1675     }
1676     }
1677     else
1678     {
1679     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1680     affiche(ligne);
1681     }
1682     }
1683     ot_cpu.ajouter_etape((char*)"analyse");
1684     double temps_analyse;
1685     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1686     change_temps_analyse(get_temps_analyse()+temps_analyse);
1687 francois 1075 return 0;
1688 ghazal 1190
1689 couturad 968 }
1690    
1691 couturad 971 int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement,
1692     MSTRUCT_VES_FILE* ves_lambda_x,
1693     MSTRUCT_VES_FILE* ves_lambda_y,
1694     MSTRUCT_VES_FILE* ves_lambda_z)
1695     {
1696     OT_CPU ot_cpu;
1697     ot_cpu.initialise();
1698     std::vector<OT_PARAMETRES*>::iterator it;
1699     char ligne[1000];
1700     for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++)
1701     {
1702     OT_PARAMETRES* param = *it;
1703     int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement");
1704     std::string Identifiant = param->get_nom((char*)"Identifiant");
1705     if(get_analyse(Identifiant)!=NULL)
1706     {
1707     std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl;
1708     return FAIL;
1709     }
1710     sprintf(ligne,"-> %s",Identifiant.c_str());
1711     affiche(ligne);
1712     if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE)
1713     {
1714     std::string Identifiant = param->get_nom((char*)"Identifiant");
1715     if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION &&
1716     ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION &&
1717     ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION)
1718     {
1719     MSTRUCT_ANALYSE_EROSION* erosion_lambda_x = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_x->get_analyse(Identifiant);
1720     MSTRUCT_ANALYSE_EROSION* erosion_lambda_y = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_y->get_analyse(Identifiant);
1721     MSTRUCT_ANALYSE_EROSION* erosion_lambda_z = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_z->get_analyse(Identifiant);
1722     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_x;
1723     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_y;
1724     std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_z;
1725     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_premiere_analyse(it_analyse_x);
1726     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_premiere_analyse(it_analyse_y);
1727     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_premiere_analyse(it_analyse_z);
1728     MSTRUCT_ANALYSE_EROSION* erosion_lambda_app = new MSTRUCT_ANALYSE_EROSION(Identifiant,
1729     erosion_lambda_x->get_epaisseur_couche(),
1730     erosion_lambda_x->get_nom_groupe_forme(),
1731     erosion_lambda_x->get_boite_analyse());
1732     while(analyse_lambda_x!=NULL && analyse_lambda_y!=NULL && analyse_lambda_z!=NULL)
1733     {
1734     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z);
1735     analyse_lambda_app->executer();
1736     erosion_lambda_app->ajouter_analyse(analyse_lambda_app);
1737     analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_suivante_analyse(it_analyse_x);
1738     analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_suivante_analyse(it_analyse_y);
1739     analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_suivante_analyse(it_analyse_z);
1740     }
1741     ajouter_analyse(erosion_lambda_app);
1742     }
1743     if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE &&
1744     ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE &&
1745     ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE)
1746     {
1747     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_x->get_analyse(Identifiant);
1748     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_y->get_analyse(Identifiant);
1749     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_z->get_analyse(Identifiant);
1750     MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z);
1751     analyse_lambda_app->executer();
1752     ajouter_analyse(analyse_lambda_app);
1753 ghazal 1190 }
1754 couturad 971 }
1755     else
1756     {
1757     sprintf(ligne,"ERREUR -> %s",Identifiant.c_str());
1758     affiche(ligne);
1759     }
1760     }
1761     ot_cpu.ajouter_etape((char*)"analyse");
1762     double temps_analyse;
1763     ot_cpu.get_etape((char*)"analyse",temps_analyse);
1764     change_temps_analyse(get_temps_analyse()+temps_analyse);
1765 francois 1075 return 0;
1766 ghazal 1190
1767 couturad 971 }
1768 couturad 968
1769    
1770 couturad 971
1771    
1772 couturad 968 int MSTRUCT_VES::exporter_maillage_abaqus(char* dossier)
1773     {
1774 couturad 933 std::ofstream f;
1775 couturad 968 char file[1000];
1776     sprintf(file,"%s/noeuds",dossier);
1777     f.open(file,std::ios::out);
1778 couturad 933 f.precision(16);
1779     f.setf(std::ios::showpoint);
1780     f << "*NODE"<< std::endl;
1781     LISTE_FEM_NOEUD::iterator it;
1782     long index=1;
1783     for (FEM_NOEUD* noeud=m_fem_maillage->get_premier_noeud(it);noeud;noeud=m_fem_maillage->get_suivant_noeud(it))
1784     {
1785     noeud->change_numero(index);
1786     double *coord=noeud->get_coord();
1787     f << noeud->get_numero() << ", " << coord[0] << ", " << coord[1] << ", " << coord[2] << std::endl;
1788     index++;
1789     }
1790     f.close();
1791 couturad 968 sprintf(file,"%s/elements",dossier);
1792     f.open(file,std::ios::out);
1793 couturad 933 f.precision(16);
1794     f.setf(std::ios::showpoint);
1795     index=1;
1796     LISTE_FEM_ELEMENT3::iterator ittele3;
1797 ghazal 1190 bool tetralin=false;
1798 couturad 933 for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1799     {
1800 francois 1150 if(ele3->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TETRA4)
1801 couturad 933 {
1802     if(tetralin==false)
1803     {
1804     tetralin=true;
1805     f << "*ELEMENT,TYPE=C3D4,ELSET=tetralin"<< std::endl;
1806     }
1807 ghazal 1190 f << index << ", "
1808     << ele3->get_fem_noeud(0)->get_numero() << ", "
1809     << ele3->get_fem_noeud(1)->get_numero() << ", "
1810     << ele3->get_fem_noeud(2)->get_numero() << ", "
1811 couturad 933 << ele3->get_fem_noeud(3)->get_numero() << std::endl;
1812     ele3->change_numero(index);
1813     index++;
1814     }
1815     }
1816     bool pentalin=false;
1817     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1818     {
1819 francois 1150 if(ele3->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_PENTA6)
1820 couturad 933 {
1821     if(pentalin==false)
1822     {
1823     pentalin=true;
1824     f << "*ELEMENT,TYPE=C3D6,ELSET=pentalin"<< std::endl;
1825     }
1826 ghazal 1190 f << index << ", "
1827     << ele3->get_fem_noeud(0)->get_numero() << ", "
1828     << ele3->get_fem_noeud(1)->get_numero() << ", "
1829     << ele3->get_fem_noeud(2)->get_numero() << ", "
1830     << ele3->get_fem_noeud(3)->get_numero() << ", "
1831     << ele3->get_fem_noeud(4)->get_numero() << ", "
1832 couturad 933 << ele3->get_fem_noeud(5)->get_numero() << std::endl;
1833     ele3->change_numero(index);
1834     index++;
1835     }
1836     }
1837     bool tetraquad=false;
1838     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1839     {
1840 francois 1150 if(ele3->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TETRA10)
1841 couturad 933 {
1842     if(tetraquad==false)
1843     {
1844     tetraquad=true;
1845     f << "*ELEMENT,TYPE=C3D10,ELSET=tetraquad"<< std::endl;
1846     }
1847 ghazal 1190 f << index << ", "
1848     << ele3->get_fem_noeud(0)->get_numero() << ", "
1849     << ele3->get_fem_noeud(2)->get_numero() << ", "
1850     << ele3->get_fem_noeud(4)->get_numero() << ", "
1851     << ele3->get_fem_noeud(9)->get_numero() << ", "
1852     << ele3->get_fem_noeud(1)->get_numero() << ", "
1853     << ele3->get_fem_noeud(3)->get_numero() << ", "
1854     << ele3->get_fem_noeud(5)->get_numero() << ", "
1855     << ele3->get_fem_noeud(6)->get_numero() << ", "
1856     << ele3->get_fem_noeud(7)->get_numero() << ", "
1857 couturad 933 << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1858     ele3->change_numero(index);
1859     index++;
1860     }
1861     }
1862     bool pentaquad=false;
1863     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1864     for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
1865     {
1866 francois 1150 if(ele3->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_PENTA15)
1867 couturad 933 {
1868     if(pentaquad==false)
1869     {
1870     pentaquad=true;
1871     f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl;
1872     }
1873 ghazal 1190 f << index << ", "
1874     << ele3->get_fem_noeud(0)->get_numero() << ", "
1875     << ele3->get_fem_noeud(2)->get_numero() << ", "
1876     << ele3->get_fem_noeud(4)->get_numero() << ", "
1877     << ele3->get_fem_noeud(9)->get_numero() << ", "
1878     << ele3->get_fem_noeud(11)->get_numero() << ", "
1879     << ele3->get_fem_noeud(13)->get_numero() << ", "
1880     << ele3->get_fem_noeud(1)->get_numero() << ", "
1881     << ele3->get_fem_noeud(3)->get_numero() << ", "
1882     << ele3->get_fem_noeud(5)->get_numero() << ", "
1883     << ele3->get_fem_noeud(10)->get_numero() << ", "
1884     << ele3->get_fem_noeud(12)->get_numero() << ", "
1885     << ele3->get_fem_noeud(14)->get_numero() << ", "
1886     << ele3->get_fem_noeud(6)->get_numero() << ", "
1887     << ele3->get_fem_noeud(7)->get_numero() << ", "
1888 couturad 933 << ele3->get_fem_noeud(8)->get_numero() << std::endl;
1889     ele3->change_numero(index);
1890     index++;
1891     }
1892     }
1893     f.close();
1894 couturad 968 sprintf(file,"%s/BC_nsets",dossier);
1895     f.open(file,std::ios::out);
1896 couturad 933 f.precision(16);
1897     f.setf(std::ios::showpoint);
1898     BOITE_3D boite3D_ves = get_boite3d_ves();
1899     double eps = get_precision();
1900     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0;
1901     TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1;
1902     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0;
1903     TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1;
1904     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0;
1905     TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1;
1906     std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face;
1907     for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face))
1908     {
1909     double xyzmin[3];
1910     double xyzmax[3];
1911 francois 1095 face->get_xyz_min_max(xyzmin,xyzmax);
1912 ghazal 1190
1913 couturad 933 if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face);
1914     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);
1915     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);
1916     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);
1917     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);
1918 ghazal 1190 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);
1919 couturad 933 }
1920     MG_SOMMET* sommet_x0y0z0=NULL;
1921     MG_SOMMET* sommet_x1y0z0=NULL;
1922     MG_SOMMET* sommet_x0y1z0=NULL;
1923     MG_SOMMET* sommet_x1y1z0=NULL;
1924     MG_SOMMET* sommet_x0y0z1=NULL;
1925     MG_SOMMET* sommet_x1y0z1=NULL;
1926     MG_SOMMET* sommet_x0y1z1=NULL;
1927     MG_SOMMET* sommet_x1y1z1=NULL;
1928     std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet;
1929     for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet))
1930     {
1931     double xyz[3];
1932     som->get_point()->evaluer(xyz);
1933     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;
1934 ghazal 1190 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;
1935 couturad 933 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;
1936 ghazal 1190 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;
1937 couturad 933 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;
1938 ghazal 1190 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;
1939 couturad 933 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;
1940     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;
1941     }
1942 ghazal 1190 f << "*NSET,NSET=coin_x0y0z0" << std::endl;
1943 couturad 933 FEM_NOEUD* coin_x0y0z0 = (FEM_NOEUD*)(sommet_x0y0z0->get_lien_fem_maillage()->get(0));
1944     f << coin_x0y0z0->get_numero() << std::endl;
1945     f << "*NSET,NSET=coin_x1y0z0" << std::endl;
1946     FEM_NOEUD* coin_x1y0z0 = (FEM_NOEUD*)(sommet_x1y0z0->get_lien_fem_maillage()->get(0));
1947     f << coin_x1y0z0->get_numero() << std::endl;
1948     f << "*NSET,NSET=coin_x0y1z0" << std::endl;
1949     FEM_NOEUD* coin_x0y1z0 = (FEM_NOEUD*)(sommet_x0y1z0->get_lien_fem_maillage()->get(0));
1950     f << coin_x0y1z0->get_numero() << std::endl;
1951     f << "*NSET,NSET=coin_x1y1z0" << std::endl;
1952     FEM_NOEUD* coin_x1y1z0 = (FEM_NOEUD*)(sommet_x1y1z0->get_lien_fem_maillage()->get(0));
1953     f << coin_x1y1z0->get_numero() << std::endl;
1954     f << "*NSET,NSET=coin_x0y0z1" << std::endl;
1955     FEM_NOEUD* coin_x0y0z1 = (FEM_NOEUD*)(sommet_x0y0z1->get_lien_fem_maillage()->get(0));
1956     f << coin_x0y0z1->get_numero() << std::endl;
1957     f << "*NSET,NSET=coin_x1y0z1" << std::endl;
1958     FEM_NOEUD* coin_x1y0z1 = (FEM_NOEUD*)(sommet_x1y0z1->get_lien_fem_maillage()->get(0));
1959     f << coin_x1y0z1->get_numero() << std::endl;
1960     f << "*NSET,NSET=coin_x0y1z1" << std::endl;
1961     FEM_NOEUD* coin_x0y1z1 = (FEM_NOEUD*)(sommet_x0y1z1->get_lien_fem_maillage()->get(0));
1962     f << coin_x0y1z1->get_numero() << std::endl;
1963     f << "*NSET,NSET=coin_x1y1z1" << std::endl;
1964     FEM_NOEUD* coin_x1y1z1 = (FEM_NOEUD*)(sommet_x1y1z1->get_lien_fem_maillage()->get(0));
1965     f << coin_x1y1z1->get_numero() << std::endl;
1966 ghazal 1190 TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan;
1967 couturad 933 f << "*NSET,NSET=xEQ0" << std::endl;
1968     for(MG_FACE* face=plan_yz_x0.get_premier(it_face_plan);face!=NULL;face=plan_yz_x0.get_suivant(it_face_plan))
1969     {
1970     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1971     long nb_ele=lst_ele->get_nb();
1972     for(long i=0;i<nb_ele;i++)
1973     {
1974     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1975     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1976     {
1977     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1978     }
1979     }
1980     }
1981     f << "*NSET,NSET=xEQ1" << std::endl;
1982     for(MG_FACE* face=plan_yz_x1.get_premier(it_face_plan);face!=NULL;face=plan_yz_x1.get_suivant(it_face_plan))
1983     {
1984     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1985     long nb_ele=lst_ele->get_nb();
1986     for(long i=0;i<nb_ele;i++)
1987     {
1988     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
1989     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
1990     {
1991     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
1992     }
1993     }
1994     }
1995     f << "*NSET,NSET=yEQ0" << std::endl;
1996     for(MG_FACE* face=plan_xz_y0.get_premier(it_face_plan);face!=NULL;face=plan_xz_y0.get_suivant(it_face_plan))
1997     {
1998     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
1999     long nb_ele=lst_ele->get_nb();
2000     for(long i=0;i<nb_ele;i++)
2001     {
2002     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2003     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
2004     {
2005     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
2006     }
2007     }
2008     }
2009     f << "*NSET,NSET=yEQ1" << std::endl;
2010     for(MG_FACE* face=plan_xz_y1.get_premier(it_face_plan);face!=NULL;face=plan_xz_y1.get_suivant(it_face_plan))
2011     {
2012     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2013     long nb_ele=lst_ele->get_nb();
2014     for(long i=0;i<nb_ele;i++)
2015     {
2016     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2017     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
2018     {
2019     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
2020     }
2021     }
2022     }
2023     f << "*NSET,NSET=zEQ0" << std::endl;
2024     for(MG_FACE* face=plan_xy_z0.get_premier(it_face_plan);face!=NULL;face=plan_xy_z0.get_suivant(it_face_plan))
2025     {
2026     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2027     long nb_ele=lst_ele->get_nb();
2028     for(long i=0;i<nb_ele;i++)
2029     {
2030     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2031     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
2032     {
2033     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
2034     }
2035     }
2036     }
2037     f << "*NSET,NSET=zEQ1" << std::endl;
2038     for(MG_FACE* face=plan_xy_z1.get_premier(it_face_plan);face!=NULL;face=plan_xy_z1.get_suivant(it_face_plan))
2039     {
2040     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2041     long nb_ele=lst_ele->get_nb();
2042     for(long i=0;i<nb_ele;i++)
2043     {
2044     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2045     for(int j=0;j<ele2->get_nb_fem_noeud();j++)
2046     {
2047     f << ele2->get_fem_noeud(j)->get_numero() << std::endl;
2048     }
2049     }
2050     }
2051     f.close();
2052 ghazal 1190
2053    
2054 couturad 1029 sprintf(file,"%s/groupes_surfaces",dossier);
2055     f.open(file,std::ios::out);
2056     f.precision(16);
2057     f.setf(std::ios::showpoint);
2058 ghazal 1190 std::map<MG_ELEMENT_MAILLAGE*,FEM_ELEMENT_MAILLAGE*> map_correspondance_mg_fem;
2059 couturad 1029 for(FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3))
2060     {
2061     MG_ELEMENT_MAILLAGE* mg_ele = ele3->get_mg_element_maillage();
2062     map_correspondance_mg_fem.insert(std::pair<MG_ELEMENT_MAILLAGE*,FEM_ELEMENT_MAILLAGE*>(mg_ele,ele3));
2063     }
2064     f << "*SURFACE,NAME=surf_xEQ0, TYPE=ELEMENT" << std::endl;
2065     for(MG_FACE* face=plan_yz_x0.get_premier(it_face_plan);face!=NULL;face=plan_yz_x0.get_suivant(it_face_plan))
2066     {
2067     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2068     long nb_ele=lst_ele->get_nb();
2069     for(long i=0;i<nb_ele;i++)
2070     {
2071     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2072 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2073 couturad 1029 {
2074     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2075     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2076     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2077     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2078     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2079     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2080     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2081     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2082     }
2083 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2084 couturad 1029 {
2085     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2086     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2087     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2088     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2089     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2090     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2091     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2092     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2093     }
2094     }
2095     }
2096     f << "*SURFACE,NAME=surf_xEQ1, TYPE=ELEMENT" << std::endl;
2097     for(MG_FACE* face=plan_yz_x1.get_premier(it_face_plan);face!=NULL;face=plan_yz_x1.get_suivant(it_face_plan))
2098     {
2099     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2100     long nb_ele=lst_ele->get_nb();
2101     for(long i=0;i<nb_ele;i++)
2102     {
2103     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2104 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2105 couturad 1029 {
2106     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2107     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2108     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2109     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2110     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2111     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2112     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2113     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2114     }
2115 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2116 couturad 1029 {
2117     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2118     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2119     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2120     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2121     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2122     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2123     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2124     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2125     }
2126     }
2127     }
2128     f << "*SURFACE,NAME=surf_yEQ0, TYPE=ELEMENT" << std::endl;
2129     for(MG_FACE* face=plan_xz_y0.get_premier(it_face_plan);face!=NULL;face=plan_xz_y0.get_suivant(it_face_plan))
2130     {
2131     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2132     long nb_ele=lst_ele->get_nb();
2133     for(long i=0;i<nb_ele;i++)
2134     {
2135     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2136 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2137 couturad 1029 {
2138     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2139     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2140     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2141     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2142     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2143     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2144     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2145     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2146     }
2147 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2148 couturad 1029 {
2149     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2150     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2151     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2152     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2153     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2154     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2155     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2156     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2157     }
2158     }
2159     }
2160     f << "*SURFACE,NAME=surf_yEQ1, TYPE=ELEMENT" << std::endl;
2161     for(MG_FACE* face=plan_xz_y1.get_premier(it_face_plan);face!=NULL;face=plan_xz_y1.get_suivant(it_face_plan))
2162     {
2163     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2164     long nb_ele=lst_ele->get_nb();
2165     for(long i=0;i<nb_ele;i++)
2166     {
2167     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2168 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2169 couturad 1029 {
2170     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2171     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2172     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2173     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2174     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2175     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2176     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2177     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2178     }
2179 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2180 couturad 1029 {
2181     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2182     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2183     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2184     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2185     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2186     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2187     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2188     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2189     }
2190     }
2191     }
2192     f << "*SURFACE,NAME=surf_zEQ0, TYPE=ELEMENT" << std::endl;
2193     for(MG_FACE* face=plan_xy_z0.get_premier(it_face_plan);face!=NULL;face=plan_xy_z0.get_suivant(it_face_plan))
2194     {
2195     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2196     long nb_ele=lst_ele->get_nb();
2197     for(long i=0;i<nb_ele;i++)
2198     {
2199     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2200 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2201 couturad 1029 {
2202     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2203     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2204     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2205     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2206     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2207     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2208     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2209     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2210     }
2211 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2212 couturad 1029 {
2213     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2214     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2215     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2216     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2217     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2218     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2219     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2220     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2221     }
2222     }
2223     }
2224     f << "*SURFACE,NAME=surf_zEQ1, TYPE=ELEMENT" << std::endl;
2225     for(MG_FACE* face=plan_xy_z1.get_premier(it_face_plan);face!=NULL;face=plan_xy_z1.get_suivant(it_face_plan))
2226     {
2227     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage();
2228     long nb_ele=lst_ele->get_nb();
2229     for(long i=0;i<nb_ele;i++)
2230     {
2231     FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i);
2232 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE3)
2233 couturad 1029 {
2234     FEM_TRIANGLE3* tri3= (FEM_TRIANGLE3*)ele2;
2235     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri3->get_mg_element_maillage();
2236     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2237     FEM_TETRA4* tet4 = (FEM_TETRA4*)map_correspondance_mg_fem.find(mgtetra)->second;
2238     if(mgtri==mgtetra->get_triangle1()) f << tet4->get_numero() << ", S1" << std::endl;
2239     else if(mgtri==mgtetra->get_triangle2()) f << tet4->get_numero() << ", S2" << std::endl;
2240     else if(mgtri==mgtetra->get_triangle3()) f << tet4->get_numero() << ", S3" << std::endl;
2241     else if(mgtri==mgtetra->get_triangle4()) f << tet4->get_numero() << ", S4" << std::endl;
2242     }
2243 francois 1150 if(ele2->get_type_entite()==MAGIC::TYPE_ENTITE::IDFEM_TRIANGLE6)
2244 couturad 1029 {
2245     FEM_TRIANGLE6* tri6= (FEM_TRIANGLE6*)ele2;
2246     MG_TRIANGLE* mgtri= (MG_TRIANGLE*)tri6->get_mg_element_maillage();
2247     MG_TETRA* mgtetra = mgtri->get_lien_tetra()->get(0);
2248     FEM_TETRA10* tet10 = (FEM_TETRA10*)map_correspondance_mg_fem.find(mgtetra)->second;
2249     if(mgtri==mgtetra->get_triangle1()) f << tet10->get_numero() << ", S1" << std::endl;
2250     else if(mgtri==mgtetra->get_triangle2()) f << tet10->get_numero() << ", S2" << std::endl;
2251     else if(mgtri==mgtetra->get_triangle3()) f << tet10->get_numero() << ", S3" << std::endl;
2252     else if(mgtri==mgtetra->get_triangle4()) f << tet10->get_numero() << ", S4" << std::endl;
2253     }
2254     }
2255 ghazal 1190 }
2256     f.close();
2257 couturad 968 sprintf(file,"%s/groupes_elements",dossier);
2258     f.open(file,std::ios::out);
2259 couturad 933 f.precision(16);
2260     f.setf(std::ios::showpoint);
2261     std::map<long,MG_CG_GROUPE_FORME*>::iterator it_groupe_forme;
2262     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))
2263     {
2264     f << "*ELSET,ELSET=" << groupe_forme->get_nom() << std::endl;
2265     TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume = groupe_forme->get_tpl_map_volume();
2266     TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_volume;
2267     for(MG_VOLUME* volume=tpl_map_volume.get_premier(it_volume);volume!=NULL;volume=tpl_map_volume.get_suivant(it_volume))
2268     {
2269     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
2270     long nb_ele=lst_ele->get_nb();
2271     for(long i=0;i<nb_ele;i++)
2272     {
2273     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
2274     f << ele3->get_numero() << std::endl;
2275     }
2276     }
2277     }
2278 ghazal 1190
2279    
2280    
2281    
2282 couturad 968 MG_CG_GROUPE_FORME* groupe_forme_particule=m_mgcg_modele->get_mgcg_groupe_forme((char*)"Particule");
2283 couturad 937 if(groupe_forme_particule!=NULL)
2284     {
2285 ghazal 1190
2286 couturad 968 sprintf(file,"%s/particules",dossier);
2287     f.open(file,std::ios::out);
2288 couturad 937 f.precision(16);
2289     f.setf(std::ios::showpoint);
2290     std::ofstream f2;
2291 couturad 1029 char file2[1000];
2292     sprintf(file2,"%s/infos_particules",dossier);
2293     f2.open(file2,std::ios::out);
2294 couturad 937 f2.precision(16);
2295     f2.setf(std::ios::showpoint);
2296 couturad 1029 std::map<long,MG_CG_FORME*>::iterator it_forme;
2297     if(groupe_forme_particule->get_premiere_mgcg_forme(it_forme)->get_mgcg_info((char*)"CENTRE")!=NULL)
2298     {
2299     f2 << "# centre_x centre_y centre_z rayon position_relative" << std::endl;
2300     }
2301     else if(groupe_forme_particule->get_premiere_mgcg_forme(it_forme)->get_mgcg_info((char*)"EXTREMITE")!=NULL)
2302     {
2303     f2 << "# extremite_x extremite_y extremite_z rayon longueur axe_x axe_y axe_z position_relative" << std::endl;
2304     }
2305 couturad 937 std::ofstream f_bord;
2306 couturad 1029 char file3[1000];
2307     sprintf(file3,"%s/particules_bord",dossier);
2308     f_bord.open(file3,std::ios::out);
2309 couturad 937 f_bord.precision(16);
2310     f_bord.setf(std::ios::showpoint);
2311     std::ofstream f_interieur;
2312 couturad 1029 char file4[1000];
2313     sprintf(file4,"%s/particules_interieur",dossier);
2314     f_interieur.open(file4,std::ios::out);
2315 couturad 937 f_interieur.precision(16);
2316     f_interieur.setf(std::ios::showpoint);
2317 couturad 1029 std::ofstream f_liste;
2318     char file5[1000];
2319     sprintf(file5,"%s/groupes_elements_particules",dossier);
2320     f_liste.open(file5,std::ios::out);
2321     f_liste.precision(16);
2322     f_liste.setf(std::ios::showpoint);
2323 couturad 937 long p=1;
2324     for(MG_CG_FORME* forme=groupe_forme_particule->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme_particule->get_suivante_mgcg_forme(it_forme))
2325     {
2326     if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
2327     {
2328     f << "*ELSET,ELSET=P_" << p << std::endl;
2329 couturad 1029 if(forme->get_mgcg_info((char*)"CENTRE")!=NULL)
2330 couturad 937 {
2331 couturad 1029 MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
2332     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
2333     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
2334     std::vector<double> vct_centre = centre->get_vct_valeur();
2335 ghazal 1190 f2 << p << " "
2336     << vct_centre.at(0) << " "
2337     << vct_centre.at(1) << " "
2338 couturad 1029 << vct_centre.at(2) << " "
2339     << rayon->get_valeur() << " "
2340 ghazal 1190 << pos_rel->get_valeur() << std::endl;
2341 couturad 1029 bool au_bord;
2342     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
2343     else au_bord=false;
2344     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
2345     MG_VOLUME* volume = forme_volume->get_mg_volume();
2346     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
2347     long nb_ele=lst_ele->get_nb();
2348     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
2349     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
2350     f_liste << "*ELSET,ELSET=P_" << p << std::endl;
2351     for(long i=0;i<nb_ele;i++)
2352     {
2353     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
2354     f << ele3->get_numero() << std::endl;
2355 ghazal 1190 if(au_bord)f_bord << ele3->get_numero() << std::endl;
2356     else f_interieur << ele3->get_numero() << std::endl;
2357     f_liste << ele3->get_numero() << std::endl;
2358 couturad 1029 }
2359     p++;
2360 couturad 937 }
2361 couturad 1029 else if(forme->get_mgcg_info((char*)"EXTREMITE")!=NULL)
2362     {
2363     MG_CG_INFO_VCT_DOUBLE* extremite = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"EXTREMITE");
2364     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
2365     MG_CG_INFO_DOUBLE* longueur = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"LONGUEUR");
2366     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
2367     std::vector<double> vct_extremite = extremite->get_vct_valeur();
2368     MG_CG_INFO_VCT_DOUBLE* axe = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"AXE");
2369     std::vector<double> vct_axe = axe->get_vct_valeur();
2370 ghazal 1190 f2 << p << " "
2371     << vct_extremite.at(0) << " "
2372     << vct_extremite.at(1) << " "
2373 couturad 1029 << vct_extremite.at(2) << " "
2374     << rayon->get_valeur() << " "
2375     << longueur->get_valeur() << " "
2376 ghazal 1190 << vct_axe.at(0) << " "
2377     << vct_axe.at(1) << " "
2378 couturad 1029 << vct_axe.at(2) << " "
2379 ghazal 1190 << pos_rel->get_valeur() << std::endl;
2380 couturad 1029 bool au_bord;
2381     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
2382     else au_bord=false;
2383     MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme;
2384     MG_VOLUME* volume = forme_volume->get_mg_volume();
2385     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
2386     long nb_ele=lst_ele->get_nb();
2387     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
2388     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
2389     f_liste << "*ELSET,ELSET=P_" << p << std::endl;
2390     for(long i=0;i<nb_ele;i++)
2391     {
2392     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
2393     f << ele3->get_numero() << std::endl;
2394 ghazal 1190 if(au_bord)f_bord << ele3->get_numero() << std::endl;
2395     else f_interieur << ele3->get_numero() << std::endl;
2396 couturad 1029 f_liste << ele3->get_numero() << std::endl;
2397     }
2398     p++;
2399     }
2400 couturad 937 }
2401     else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
2402     {
2403     f << "*ELSET,ELSET=P_" << p << std::endl;
2404     MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE");
2405     MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON");
2406     MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE");
2407     std::vector<double> vct_centre = centre->get_vct_valeur();
2408 ghazal 1190 f2 << p << " "
2409     << vct_centre.at(0) << " "
2410     << vct_centre.at(1) << " "
2411 couturad 937 << vct_centre.at(2) << " "
2412     << rayon->get_valeur() << " "
2413 ghazal 1190 << pos_rel->get_valeur() << std::endl;
2414 couturad 937 bool au_bord;
2415     if(pos_rel->get_valeur()=="AU_BORD") au_bord=true;
2416     else au_bord=false;
2417     MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme;
2418     std::map<long,MG_VOLUME*>::iterator it_volume;
2419     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))
2420     {
2421     TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage();
2422     long nb_ele=lst_ele->get_nb();
2423     if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl;
2424     else f_interieur << "*ELSET,ELSET=P_" << p << std::endl;
2425     for(long i=0;i<nb_ele;i++)
2426     {
2427     FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i);
2428     f << ele3->get_numero() << std::endl;
2429 ghazal 1190 if(au_bord)f_bord << ele3->get_numero() << std::endl;
2430     else f_interieur << ele3->get_numero() << std::endl;
2431 couturad 937 }
2432     }
2433     p++;
2434     }
2435     }
2436     f_bord.close();
2437     f_interieur.close();
2438 couturad 1029 f_liste.close();
2439 couturad 937 f2.close();
2440     f.close();
2441 ghazal 1190 }
2442 francois 1075 return 0;
2443 ghazal 1190
2444 couturad 933 }
2445 couturad 926
2446 couturad 933
2447 couturad 926 int MSTRUCT_VES::enregistrer(char* fichier_ves)
2448 couturad 919 {
2449 couturad 926 m_ves_file->enregistrer(fichier_ves);
2450 francois 1075 return 0;
2451 ghazal 1190
2452 couturad 919 }
2453    
2454 couturad 926 int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic)
2455 couturad 919 {
2456 couturad 926 m_ves_file->change_nom_fichier_magic(fichier_magic);
2457     m_ves_file->enregistrer(fichier_ves);
2458     m_mg_gestionnaire->enregistrer(fichier_magic);
2459 francois 1075 return 0;
2460 couturad 919 }
2461    
2462 couturad 951 void MSTRUCT_VES::active_affichage(fonction_affiche* fonc)
2463 couturad 919 {
2464     fonc_affiche = fonc;
2465     affichageactif = 1;
2466     }
2467    
2468 couturad 926 void MSTRUCT_VES::affiche(char* message)
2469 couturad 919 {
2470     if(affichageactif==1) fonc_affiche(message);
2471     }
2472    
2473    
2474    
2475    
2476    
2477 ghazal 1190