ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/microstructure/src/mstruct_ves.cpp
Revision: 1192
Committed: Thu May 22 13:10:41 2025 UTC (5 weeks, 1 day ago) by francois
File size: 119240 byte(s)
Log Message:
bug de bracket mal place

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