1 |
couturad |
919 |
#include "mstruct_ves.h" |
2 |
|
|
#include "mg_volume.h" |
3 |
|
|
#include "mg_geometrie.h" |
4 |
|
|
#include "mg_maillage.h" |
5 |
|
|
#include "fem_maillage.h" |
6 |
|
|
#include "mg_gestionnaire.h" |
7 |
|
|
#include "mstruct_groupe_volume.h" |
8 |
|
|
#include "mstruct_parametres.h" |
9 |
|
|
#include "mstruct_generateur_rsa.h" |
10 |
couturad |
951 |
#include "mstruct_generateur_dcr.h" |
11 |
couturad |
968 |
#include "mstruct_definition.h" |
12 |
|
|
#include "mstruct_analyse_champ.h" |
13 |
|
|
#include "mstruct_analyse_orientation.h" |
14 |
|
|
#include "mstruct_analyse_cao.h" |
15 |
couturad |
971 |
#include "mstruct_analyse_propriete_massique.h" |
16 |
couturad |
968 |
#include "mstruct_analyse_mg_maillage.h" |
17 |
|
|
#include "mstruct_analyse_fem_maillage.h" |
18 |
|
|
#include "mstruct_analyse_erosion.h" |
19 |
|
|
#include "mstruct_analyse_modules_elasticite.h" |
20 |
couturad |
971 |
#include "mstruct_analyse_conductivite_thermique.h" |
21 |
couturad |
919 |
#include "mg_cg_modele.h" |
22 |
|
|
#include "mg_cg_assemblage.h" |
23 |
|
|
#include "mg_sous_geometrie.h" |
24 |
|
|
#include "mg_cg_forme_multi_volume.h" |
25 |
couturad |
937 |
#include "mg_cg_info.h" |
26 |
couturad |
919 |
#include "mg_file.h" |
27 |
|
|
#include "fct_taille_fem_solution_generateur_microstructure.h" |
28 |
couturad |
951 |
#include "mailleur3d_couche.h" |
29 |
couturad |
919 |
#include "mailleur0d.h" |
30 |
|
|
#include "mailleur1d.h" |
31 |
|
|
#include "mailleur2d.h" |
32 |
|
|
#include "mailleur3d.h" |
33 |
|
|
#include "mailleur_fem.h" |
34 |
|
|
#include "mailleur_analyse.h" |
35 |
|
|
#include <fstream> |
36 |
|
|
#include "mgaster.h" |
37 |
|
|
#include "ot_cpu.h" |
38 |
|
|
#include "mstruct_outils.h" |
39 |
couturad |
926 |
#include "mg_cg_groupe_forme.h" |
40 |
|
|
#include "mstruct_ves_file.h" |
41 |
couturad |
933 |
#include "fem_tetra4.h" |
42 |
|
|
#include "fem_tetra10.h" |
43 |
|
|
#include "fem_penta6.h" |
44 |
|
|
#include "fem_penta15.h" |
45 |
couturad |
951 |
#include "parse.h" |
46 |
|
|
#include "pars_argument.h" |
47 |
couturad |
926 |
MSTRUCT_VES::MSTRUCT_VES(void) |
48 |
couturad |
919 |
{ |
49 |
|
|
m_mg_gestionnaire=new MG_GESTIONNAIRE; |
50 |
|
|
m_mg_geometrie=NULL; |
51 |
|
|
m_mgcg_modele=NULL; |
52 |
couturad |
926 |
m_mgcg_assemblage=NULL; |
53 |
couturad |
919 |
m_mg_maillage=NULL; |
54 |
|
|
m_fem_maillage=NULL; |
55 |
couturad |
926 |
m_ves_file=new MSTRUCT_VES_FILE; |
56 |
|
|
change_boite_3D_ves(BOITE_3D(0.0,0.0,0.0,1.0,1.0,1.0)); |
57 |
|
|
change_precision(1.0e-06); |
58 |
|
|
change_temps_geometrie(0.0); |
59 |
|
|
change_temps_carte(0.0); |
60 |
|
|
change_temps_maillage(0.0); |
61 |
|
|
change_temps_fem_maillage(0.0); |
62 |
|
|
change_temps_etude(0.0); |
63 |
|
|
change_temps_calcul(0.0); |
64 |
|
|
change_temps_analyse(0.0); |
65 |
couturad |
919 |
} |
66 |
|
|
|
67 |
couturad |
926 |
MSTRUCT_VES::MSTRUCT_VES(char* fichier_ves) |
68 |
couturad |
919 |
{ |
69 |
couturad |
926 |
m_ves_file=new MSTRUCT_VES_FILE; |
70 |
|
|
m_ves_file->ouvrir(fichier_ves); |
71 |
|
|
m_mg_gestionnaire = new MG_FILE(m_ves_file->get_nom_fichier_magic()); |
72 |
|
|
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()); |
73 |
|
|
else m_mgcg_modele=NULL; |
74 |
|
|
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()); |
75 |
|
|
else m_mgcg_assemblage=NULL; |
76 |
|
|
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()); |
77 |
|
|
else m_mg_geometrie = NULL; |
78 |
|
|
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()); |
79 |
|
|
else m_mg_maillage = NULL; |
80 |
|
|
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()); |
81 |
|
|
else m_fem_maillage = NULL; |
82 |
couturad |
919 |
} |
83 |
|
|
|
84 |
couturad |
926 |
MSTRUCT_VES::~MSTRUCT_VES(void) |
85 |
couturad |
919 |
{ |
86 |
|
|
delete m_mg_gestionnaire; |
87 |
couturad |
926 |
delete m_ves_file; |
88 |
couturad |
919 |
} |
89 |
|
|
|
90 |
couturad |
926 |
MG_GESTIONNAIRE* MSTRUCT_VES::get_mg_gestionnaire(void) |
91 |
couturad |
919 |
{ |
92 |
|
|
return m_mg_gestionnaire; |
93 |
|
|
} |
94 |
|
|
|
95 |
couturad |
926 |
void MSTRUCT_VES::change_mg_gestionnaire(MG_GESTIONNAIRE* gest) |
96 |
couturad |
919 |
{ |
97 |
couturad |
926 |
m_mg_gestionnaire=gest; |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
void MSTRUCT_VES::change_mg_geometrie(MG_GEOMETRIE* mg_geometrie) |
101 |
|
|
{ |
102 |
couturad |
919 |
m_mg_geometrie=mg_geometrie; |
103 |
couturad |
926 |
m_ves_file->change_id_mg_geometrie(m_mg_geometrie->get_id()); |
104 |
couturad |
919 |
} |
105 |
|
|
|
106 |
couturad |
926 |
MG_GEOMETRIE* MSTRUCT_VES::get_mg_geometrie(void) |
107 |
couturad |
919 |
{ |
108 |
|
|
return m_mg_geometrie; |
109 |
|
|
} |
110 |
|
|
|
111 |
couturad |
926 |
void MSTRUCT_VES::change_mgcg_assemblage(MG_CG_ASSEMBLAGE* mgcg_assemblage) |
112 |
couturad |
919 |
{ |
113 |
|
|
m_mgcg_assemblage=mgcg_assemblage; |
114 |
couturad |
926 |
m_ves_file->change_id_mgcg_assemblage(m_mgcg_assemblage->get_id()); |
115 |
couturad |
919 |
} |
116 |
|
|
|
117 |
couturad |
926 |
MG_CG_ASSEMBLAGE* MSTRUCT_VES::get_mgcg_assemblage(void) |
118 |
couturad |
919 |
{ |
119 |
|
|
return m_mgcg_assemblage; |
120 |
|
|
} |
121 |
|
|
|
122 |
couturad |
926 |
void MSTRUCT_VES::change_mgcg_modele(MG_CG_MODELE* mgcg_modele) |
123 |
couturad |
919 |
{ |
124 |
|
|
m_mgcg_modele=mgcg_modele; |
125 |
couturad |
926 |
m_ves_file->change_id_mgcg_modele(m_mgcg_modele->get_id()); |
126 |
couturad |
919 |
} |
127 |
|
|
|
128 |
couturad |
926 |
MG_CG_MODELE* MSTRUCT_VES::get_mgcg_modele(void) |
129 |
couturad |
919 |
{ |
130 |
|
|
return m_mgcg_modele; |
131 |
|
|
} |
132 |
|
|
|
133 |
couturad |
926 |
MG_MAILLAGE* MSTRUCT_VES::get_mg_maillage(void) |
134 |
couturad |
919 |
{ |
135 |
|
|
return m_mg_maillage; |
136 |
|
|
} |
137 |
|
|
|
138 |
couturad |
926 |
void MSTRUCT_VES::change_mg_maillage(MG_MAILLAGE* mg_maillage) |
139 |
couturad |
919 |
{ |
140 |
|
|
m_mg_maillage=mg_maillage; |
141 |
couturad |
926 |
m_ves_file->change_id_mg_maillage(m_mg_maillage->get_id()); |
142 |
couturad |
919 |
} |
143 |
|
|
|
144 |
couturad |
926 |
FEM_MAILLAGE* MSTRUCT_VES::get_fem_maillage(void) |
145 |
couturad |
919 |
{ |
146 |
|
|
return m_fem_maillage; |
147 |
|
|
} |
148 |
|
|
|
149 |
couturad |
926 |
void MSTRUCT_VES::change_fem_maillage(FEM_MAILLAGE* fem_maillage) |
150 |
couturad |
919 |
{ |
151 |
|
|
m_fem_maillage=fem_maillage; |
152 |
couturad |
926 |
m_ves_file->change_id_fem_maillage(m_fem_maillage->get_id()); |
153 |
couturad |
919 |
} |
154 |
|
|
|
155 |
couturad |
926 |
BOITE_3D MSTRUCT_VES::get_boite3d_ves(void) |
156 |
couturad |
919 |
{ |
157 |
couturad |
926 |
return m_ves_file->get_boite_3D_ves(); |
158 |
couturad |
919 |
} |
159 |
|
|
|
160 |
couturad |
926 |
void MSTRUCT_VES::change_boite_3D_ves(BOITE_3D boite3D) |
161 |
couturad |
919 |
{ |
162 |
couturad |
926 |
m_ves_file->change_boite_3D_ves(boite3D); |
163 |
couturad |
919 |
} |
164 |
|
|
|
165 |
couturad |
926 |
double MSTRUCT_VES::get_precision(void) |
166 |
couturad |
919 |
{ |
167 |
couturad |
926 |
return m_ves_file->get_precision(); |
168 |
couturad |
919 |
} |
169 |
|
|
|
170 |
couturad |
926 |
void MSTRUCT_VES::change_precision(double precision) |
171 |
couturad |
919 |
{ |
172 |
couturad |
926 |
m_ves_file->change_precision(precision); |
173 |
couturad |
919 |
} |
174 |
|
|
|
175 |
couturad |
926 |
double MSTRUCT_VES::get_temps_geometrie(void) |
176 |
couturad |
919 |
{ |
177 |
couturad |
926 |
return m_ves_file->get_temps_geometrie(); |
178 |
couturad |
919 |
} |
179 |
|
|
|
180 |
couturad |
926 |
void MSTRUCT_VES::change_temps_geometrie(double temps) |
181 |
couturad |
919 |
{ |
182 |
couturad |
926 |
m_ves_file->change_temps_geometrie(temps); |
183 |
couturad |
919 |
} |
184 |
|
|
|
185 |
couturad |
926 |
double MSTRUCT_VES::get_temps_materiau(void) |
186 |
|
|
{ |
187 |
|
|
return m_ves_file->get_temps_materiau(); |
188 |
|
|
} |
189 |
couturad |
919 |
|
190 |
couturad |
926 |
void MSTRUCT_VES::change_temps_materiau(double temps) |
191 |
couturad |
919 |
{ |
192 |
couturad |
926 |
m_ves_file->change_temps_materiau(temps); |
193 |
|
|
} |
194 |
|
|
|
195 |
|
|
double MSTRUCT_VES::get_temps_carte(void) |
196 |
|
|
{ |
197 |
|
|
return m_ves_file->get_temps_carte(); |
198 |
|
|
} |
199 |
|
|
|
200 |
|
|
void MSTRUCT_VES::change_temps_carte(double temps) |
201 |
|
|
{ |
202 |
|
|
m_ves_file->change_temps_carte(temps); |
203 |
|
|
} |
204 |
|
|
|
205 |
|
|
double MSTRUCT_VES::get_temps_maillage(void) |
206 |
|
|
{ |
207 |
|
|
return m_ves_file->get_temps_maillage(); |
208 |
|
|
} |
209 |
|
|
|
210 |
|
|
void MSTRUCT_VES::change_temps_maillage(double temps) |
211 |
|
|
{ |
212 |
|
|
m_ves_file->change_temps_maillage(temps); |
213 |
|
|
} |
214 |
|
|
|
215 |
|
|
double MSTRUCT_VES::get_temps_fem_maillage(void) |
216 |
|
|
{ |
217 |
|
|
return m_ves_file->get_temps_fem_maillage(); |
218 |
|
|
} |
219 |
|
|
|
220 |
|
|
void MSTRUCT_VES::change_temps_fem_maillage(double temps) |
221 |
|
|
{ |
222 |
|
|
m_ves_file->change_temps_fem_maillage(temps); |
223 |
|
|
} |
224 |
|
|
|
225 |
|
|
double MSTRUCT_VES::get_temps_etude(void) |
226 |
|
|
{ |
227 |
|
|
return m_ves_file->get_temps_etude(); |
228 |
|
|
} |
229 |
|
|
|
230 |
|
|
void MSTRUCT_VES::change_temps_etude(double temps) |
231 |
|
|
{ |
232 |
|
|
m_ves_file->change_temps_etude(temps); |
233 |
|
|
} |
234 |
|
|
|
235 |
|
|
double MSTRUCT_VES::get_temps_calcul(void) |
236 |
|
|
{ |
237 |
|
|
return m_ves_file->get_temps_calcul(); |
238 |
|
|
} |
239 |
|
|
|
240 |
|
|
void MSTRUCT_VES::change_temps_calcul(double temps) |
241 |
|
|
{ |
242 |
|
|
m_ves_file->change_temps_calcul(temps); |
243 |
|
|
} |
244 |
|
|
|
245 |
|
|
double MSTRUCT_VES::get_temps_analyse(void) |
246 |
|
|
{ |
247 |
|
|
return m_ves_file->get_temps_analyse(); |
248 |
|
|
} |
249 |
|
|
|
250 |
|
|
void MSTRUCT_VES::change_temps_analyse(double temps) |
251 |
|
|
{ |
252 |
|
|
m_ves_file->change_temps_analyse(temps); |
253 |
|
|
} |
254 |
|
|
|
255 |
|
|
long int MSTRUCT_VES::get_nb_analyse(void) |
256 |
|
|
{ |
257 |
|
|
return m_ves_file->get_nb_analyse(); |
258 |
|
|
} |
259 |
|
|
|
260 |
|
|
int MSTRUCT_VES::ajouter_analyse(MSTRUCT_ANALYSE* analyse_ves) |
261 |
|
|
{ |
262 |
|
|
return m_ves_file->ajouter_analyse(analyse_ves); |
263 |
|
|
} |
264 |
|
|
|
265 |
|
|
MSTRUCT_ANALYSE* MSTRUCT_VES::get_premiere_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it) |
266 |
|
|
{ |
267 |
|
|
return m_ves_file->get_premiere_analyse(it); |
268 |
|
|
} |
269 |
|
|
|
270 |
|
|
MSTRUCT_ANALYSE* MSTRUCT_VES::get_suivante_analyse(std::map< std::string, MSTRUCT_ANALYSE* >::iterator& it) |
271 |
|
|
{ |
272 |
|
|
return m_ves_file->get_suivante_analyse(it); |
273 |
|
|
} |
274 |
|
|
|
275 |
couturad |
951 |
MSTRUCT_ANALYSE* MSTRUCT_VES::get_analyse(std::string identifiant) |
276 |
couturad |
926 |
{ |
277 |
|
|
return m_ves_file->get_analyse(identifiant); |
278 |
|
|
} |
279 |
|
|
|
280 |
couturad |
951 |
int MSTRUCT_VES::supprimer_analyse(std::string identifiant) |
281 |
couturad |
926 |
{ |
282 |
|
|
return m_ves_file->supprimer_analyse(identifiant); |
283 |
|
|
} |
284 |
|
|
|
285 |
|
|
int MSTRUCT_VES::supprimer_tout_analyse(void) |
286 |
|
|
{ |
287 |
|
|
return m_ves_file->supprimer_tout_analyse(); |
288 |
|
|
} |
289 |
|
|
|
290 |
|
|
int MSTRUCT_VES::generer_geometrie(std::vector< OT_PARAMETRES* >& vector_params_geometrie) |
291 |
|
|
{ |
292 |
couturad |
919 |
OT_CPU ot_cpu; |
293 |
|
|
ot_cpu.initialise(); |
294 |
couturad |
951 |
MSTRUCT_GENERATEUR* generateur=NULL; |
295 |
couturad |
919 |
std::vector<OT_PARAMETRES*>::iterator it; |
296 |
|
|
for(it=vector_params_geometrie.begin();it!=vector_params_geometrie.end();it++) |
297 |
|
|
{ |
298 |
|
|
OT_PARAMETRES* param = *it; |
299 |
couturad |
968 |
if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::RSA) |
300 |
couturad |
919 |
{ |
301 |
|
|
std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele"); |
302 |
couturad |
951 |
MSTRUCT_GENERATEUR_RSA *RSA; |
303 |
|
|
if(generateur==NULL) |
304 |
|
|
{ |
305 |
|
|
RSA = new MSTRUCT_GENERATEUR_RSA(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str()); |
306 |
|
|
generateur=RSA; |
307 |
|
|
RSA->active_affichage(fonc_affiche); |
308 |
|
|
} |
309 |
|
|
|
310 |
couturad |
919 |
double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin"); |
311 |
|
|
double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin"); |
312 |
|
|
double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin"); |
313 |
|
|
double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax"); |
314 |
|
|
double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax"); |
315 |
|
|
double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax"); |
316 |
|
|
BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin, |
317 |
|
|
Boite3D_distribution_Ymin, |
318 |
|
|
Boite3D_distribution_Zmin, |
319 |
|
|
Boite3D_distribution_Xmax, |
320 |
|
|
Boite3D_distribution_Ymax, |
321 |
|
|
Boite3D_distribution_Zmax); |
322 |
couturad |
951 |
RSA->change_boite3d_distribution(Boite3D_distribution); |
323 |
couturad |
919 |
double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X"); |
324 |
|
|
double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y"); |
325 |
couturad |
951 |
double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z"); |
326 |
|
|
RSA->change_nb_pas_grille(Nb_pas_X); |
327 |
|
|
double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume"); |
328 |
|
|
RSA->change_distance_inter_volume_min(Distance_min_inter_volume); |
329 |
couturad |
919 |
double Volume_min = param->get_valeur((char*)"Volume_min"); |
330 |
couturad |
951 |
RSA->change_volume_min(Volume_min); |
331 |
couturad |
919 |
double Aire_min = param->get_valeur((char*)"Aire_min"); |
332 |
couturad |
951 |
RSA->change_aire_min(Aire_min); |
333 |
couturad |
919 |
double Longueur_min = param->get_valeur((char*)"Longueur_min"); |
334 |
couturad |
951 |
RSA->change_longueur_min(Longueur_min); |
335 |
couturad |
919 |
double Angle_min = param->get_valeur((char*)"Angle_min"); |
336 |
couturad |
951 |
RSA->change_angle_min(Angle_min); |
337 |
couturad |
919 |
double Nb_iteration_max = param->get_valeur((char*)"Nb_iteration_max"); |
338 |
couturad |
951 |
RSA->change_nb_iteration_max(Nb_iteration_max); |
339 |
|
|
bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections"); |
340 |
|
|
RSA->change_intersection_bords_ves(Avec_intersections); |
341 |
|
|
std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion"); |
342 |
couturad |
971 |
char message[1000]; |
343 |
|
|
sprintf(message,"Generateur RSA : %s",Nom_groupe_inclusion.c_str()); |
344 |
|
|
affiche(message); |
345 |
couturad |
951 |
int Type_inclusion = param->get_valeur((char*)"Type_inclusion"); |
346 |
couturad |
919 |
double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible"); |
347 |
couturad |
951 |
double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique"); |
348 |
|
|
bool Porosite = (bool)param->get_valeur((char*)"Porosite"); |
349 |
|
|
std::string multicouche = param->get_nom((char*)"Multicouche"); |
350 |
|
|
PARS_ARGUMENT parse_param[100]; |
351 |
|
|
PARSE parse; |
352 |
|
|
parse.decode(multicouche.c_str(),"@,(&)",parse_param); |
353 |
|
|
std::vector<double> *vector_epaisseur=NULL; |
354 |
|
|
int nb_couche = atoi(parse_param[0].argument[0].c_str()); |
355 |
|
|
if(nb_couche>0) |
356 |
couturad |
919 |
{ |
357 |
couturad |
951 |
vector_epaisseur=new std::vector<double>; |
358 |
|
|
for(int i=0;i<nb_couche;i++) |
359 |
|
|
{ |
360 |
|
|
double epaisseur=atof(parse_param[1].argument[i].c_str()); |
361 |
|
|
vector_epaisseur->push_back(epaisseur); |
362 |
|
|
} |
363 |
|
|
} |
364 |
couturad |
968 |
if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE) |
365 |
couturad |
951 |
{ |
366 |
couturad |
966 |
double Mu_rayon = param->get_valeur((char*)"Mu_rayon"); |
367 |
|
|
double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon"); |
368 |
|
|
double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon"); |
369 |
|
|
double fraction_volumique_actuelle=0.0; |
370 |
|
|
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); |
371 |
couturad |
919 |
} |
372 |
couturad |
968 |
else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE) |
373 |
couturad |
919 |
{ |
374 |
couturad |
966 |
double Mu_rayon = param->get_valeur((char*)"Mu_rayon"); |
375 |
|
|
double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon"); |
376 |
|
|
double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon"); |
377 |
|
|
double Mu_longueur = param->get_valeur((char*)"Mu_longueur"); |
378 |
|
|
double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur"); |
379 |
|
|
double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur"); |
380 |
|
|
double Mu_theta = param->get_valeur((char*)"Mu_theta"); |
381 |
|
|
double Sigma_theta = param->get_valeur((char*)"Sigma_theta"); |
382 |
|
|
double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta"); |
383 |
|
|
double Mu_phi = param->get_valeur((char*)"Mu_phi"); |
384 |
|
|
double Sigma_phi = param->get_valeur((char*)"Sigma_phi"); |
385 |
|
|
double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi"); |
386 |
|
|
double fraction_volumique_actuelle=0.0; |
387 |
|
|
RSA->tirrage_aleatoire_cylindre(Nom_groupe_inclusion, |
388 |
|
|
Mu_rayon,Sigma_rayon,Type_distribution_rayon, |
389 |
|
|
Mu_longueur,Sigma_longueur,Type_distribution_longueur, |
390 |
|
|
Mu_theta,Sigma_theta,Type_distribution_theta, |
391 |
|
|
Mu_phi,Sigma_phi,Type_distribution_phi, |
392 |
|
|
Fraction_volumique_cible,Eps_fraction_volumique,fraction_volumique_actuelle, |
393 |
|
|
vector_epaisseur, |
394 |
|
|
Porosite); |
395 |
couturad |
919 |
} |
396 |
couturad |
951 |
if(vector_epaisseur!=NULL) delete vector_epaisseur; |
397 |
|
|
} |
398 |
couturad |
968 |
else if(((int)param->get_valeur((char*)"Type_generateur"))==MSTRUCT::TYPE_GENERATEUR::DCR) |
399 |
couturad |
951 |
{ |
400 |
couturad |
952 |
#ifdef PROJECT_CHRONO |
401 |
couturad |
951 |
std::string Nom_mgcg_modele = param->get_nom((char*)"Nom_mgcg_modele"); |
402 |
|
|
MSTRUCT_GENERATEUR_DCR *DCR; |
403 |
|
|
if(generateur==NULL) |
404 |
|
|
{ |
405 |
|
|
DCR = new MSTRUCT_GENERATEUR_DCR(m_mg_gestionnaire,(char*)Nom_mgcg_modele.c_str()); |
406 |
|
|
generateur=DCR; |
407 |
|
|
DCR->active_affichage(fonc_affiche); |
408 |
|
|
} |
409 |
|
|
double Boite3D_distribution_Xmin = param->get_valeur((char*)"Boite3D_distribution_Xmin"); |
410 |
|
|
double Boite3D_distribution_Ymin = param->get_valeur((char*)"Boite3D_distribution_Ymin"); |
411 |
|
|
double Boite3D_distribution_Zmin = param->get_valeur((char*)"Boite3D_distribution_Zmin"); |
412 |
|
|
double Boite3D_distribution_Xmax = param->get_valeur((char*)"Boite3D_distribution_Xmax"); |
413 |
|
|
double Boite3D_distribution_Ymax = param->get_valeur((char*)"Boite3D_distribution_Ymax"); |
414 |
|
|
double Boite3D_distribution_Zmax = param->get_valeur((char*)"Boite3D_distribution_Zmax"); |
415 |
|
|
BOITE_3D Boite3D_distribution(Boite3D_distribution_Xmin, |
416 |
|
|
Boite3D_distribution_Ymin, |
417 |
|
|
Boite3D_distribution_Zmin, |
418 |
|
|
Boite3D_distribution_Xmax, |
419 |
|
|
Boite3D_distribution_Ymax, |
420 |
|
|
Boite3D_distribution_Zmax); |
421 |
|
|
DCR->change_boite3d_distribution(Boite3D_distribution); |
422 |
|
|
double Nb_pas_X = param->get_valeur((char*)"Nb_pas_X"); |
423 |
|
|
double Nb_pas_Y = param->get_valeur((char*)"Nb_pas_Y"); |
424 |
|
|
double Nb_pas_Z = param->get_valeur((char*)"Nb_pas_Z"); |
425 |
|
|
DCR->change_nb_pas_grille(Nb_pas_X); |
426 |
|
|
double Distance_min_inter_volume = param->get_valeur((char*)"Distance_min_inter_volume"); |
427 |
|
|
DCR->change_distance_inter_volume_min(Distance_min_inter_volume); |
428 |
|
|
double Volume_min = param->get_valeur((char*)"Volume_min"); |
429 |
|
|
DCR->change_volume_min(Volume_min); |
430 |
|
|
double Aire_min = param->get_valeur((char*)"Aire_min"); |
431 |
|
|
DCR->change_aire_min(Aire_min); |
432 |
|
|
double Longueur_min = param->get_valeur((char*)"Longueur_min"); |
433 |
|
|
DCR->change_longueur_min(Longueur_min); |
434 |
|
|
double Angle_min = param->get_valeur((char*)"Angle_min"); |
435 |
|
|
DCR->change_angle_min(Angle_min); |
436 |
couturad |
966 |
long Nb_iteration_max = (long)param->get_valeur((char*)"Nb_iteration_max"); |
437 |
couturad |
951 |
bool Avec_intersections = (bool)param->get_valeur((char*)"Avec_intersections"); |
438 |
|
|
DCR->change_intersection_bords_ves(Avec_intersections); |
439 |
|
|
std::string Nom_groupe_inclusion = param->get_nom((char*)"Nom_groupe_inclusion"); |
440 |
couturad |
971 |
char message[1000]; |
441 |
|
|
sprintf(message,"Generateur DCR : %s",Nom_groupe_inclusion.c_str()); |
442 |
|
|
affiche(message); |
443 |
couturad |
951 |
int Type_inclusion = param->get_valeur((char*)"Type_inclusion"); |
444 |
|
|
double Fraction_volumique_cible = param->get_valeur((char*)"Fraction_volumique_cible"); |
445 |
|
|
double Eps_fraction_volumique = param->get_valeur((char*)"Eps_fraction_volumique"); |
446 |
|
|
bool Porosite = (bool)param->get_valeur((char*)"Porosite"); |
447 |
|
|
std::string multicouche = param->get_nom((char*)"Multicouche"); |
448 |
couturad |
919 |
|
449 |
couturad |
960 |
bool Avec_interface_graphique = (bool)param->get_valeur((char*)"Avec_interface_graphique"); |
450 |
|
|
double Facteur_reduction_vitesse = param->get_valeur((char*)"Facteur_reduction_vitesse"); |
451 |
|
|
double Friction = param->get_valeur((char*)"Friction"); |
452 |
|
|
double Pas_temps_sim = param->get_valeur((char*)"Pas_temps_sim"); |
453 |
|
|
double Temps_max_sim = param->get_valeur((char*)"Temps_max_sim"); |
454 |
|
|
double Eps_vitesse = param->get_valeur((char*)"Eps_vitesse"); |
455 |
|
|
DCR->active_interface_graphique(Avec_interface_graphique); |
456 |
|
|
DCR->change_facteur_reduction_vitesse(Facteur_reduction_vitesse); |
457 |
|
|
DCR->change_eps_vitesse(Eps_vitesse); |
458 |
|
|
DCR->change_friction(Friction); |
459 |
|
|
DCR->change_pas_temps(Pas_temps_sim); |
460 |
|
|
DCR->change_temps_max_sim(Temps_max_sim); |
461 |
couturad |
971 |
|
462 |
couturad |
968 |
if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::SPHERE) |
463 |
couturad |
951 |
{ |
464 |
couturad |
966 |
double Mu_rayon = param->get_valeur((char*)"Mu_rayon"); |
465 |
|
|
double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon"); |
466 |
|
|
double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon"); |
467 |
couturad |
971 |
DCR->ajouter_spheres(Nom_groupe_inclusion,Mu_rayon,Sigma_rayon,Type_distribution_rayon,Fraction_volumique_cible,Eps_fraction_volumique,Porosite); |
468 |
couturad |
966 |
} |
469 |
couturad |
968 |
else if(Type_inclusion==MSTRUCT::TYPE_INCLUSION::CYLINDRE) |
470 |
couturad |
966 |
{ |
471 |
|
|
double Mu_rayon = param->get_valeur((char*)"Mu_rayon"); |
472 |
|
|
double Sigma_rayon = param->get_valeur((char*)"Sigma_rayon"); |
473 |
|
|
double Type_distribution_rayon = param->get_valeur((char*)"Type_distribution_rayon"); |
474 |
|
|
double Mu_longueur = param->get_valeur((char*)"Mu_longueur"); |
475 |
|
|
double Sigma_longueur = param->get_valeur((char*)"Sigma_longueur"); |
476 |
|
|
double Type_distribution_longueur = param->get_valeur((char*)"Type_distribution_longueur"); |
477 |
|
|
double Mu_theta = param->get_valeur((char*)"Mu_theta"); |
478 |
|
|
double Sigma_theta = param->get_valeur((char*)"Sigma_theta"); |
479 |
|
|
double Type_distribution_theta = param->get_valeur((char*)"Type_distribution_theta"); |
480 |
|
|
double Mu_phi = param->get_valeur((char*)"Mu_phi"); |
481 |
|
|
double Sigma_phi = param->get_valeur((char*)"Sigma_phi"); |
482 |
|
|
double Type_distribution_phi = param->get_valeur((char*)"Type_distribution_phi"); |
483 |
|
|
DCR->ajouter_cylindres(Nom_groupe_inclusion, |
484 |
|
|
Mu_rayon,Sigma_rayon,Type_distribution_rayon, |
485 |
|
|
Mu_longueur,Sigma_longueur,Type_distribution_longueur, |
486 |
|
|
Mu_theta,Sigma_theta,Type_distribution_theta, |
487 |
|
|
Mu_phi,Sigma_phi,Type_distribution_phi, |
488 |
couturad |
971 |
Fraction_volumique_cible,Eps_fraction_volumique, |
489 |
|
|
Porosite); |
490 |
couturad |
966 |
} |
491 |
couturad |
971 |
#else |
492 |
|
|
std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl; |
493 |
|
|
#endif |
494 |
|
|
} |
495 |
|
|
} |
496 |
|
|
if(generateur->get_type()==MSTRUCT::TYPE_GENERATEUR::DCR) |
497 |
|
|
{ |
498 |
|
|
#ifdef PROJECT_CHRONO |
499 |
|
|
MSTRUCT_GENERATEUR_DCR *DCR= (MSTRUCT_GENERATEUR_DCR*)generateur; |
500 |
|
|
if(DCR->lancer_simulation()==FAIL) |
501 |
couturad |
966 |
{ |
502 |
|
|
delete generateur; |
503 |
couturad |
971 |
return FAIL; |
504 |
couturad |
966 |
} |
505 |
couturad |
971 |
DCR->generer_geometrie(); |
506 |
couturad |
952 |
#else |
507 |
|
|
std::cerr << "*** ERREUR : MSTRUCT_VES::generer_geometrie : PROJECT_CHRONO absent ***" << std::endl; |
508 |
couturad |
971 |
#endif |
509 |
couturad |
919 |
} |
510 |
|
|
ot_cpu.ajouter_etape((char*)"generation_geometrie"); |
511 |
couturad |
926 |
double temps_generation_geometrie; |
512 |
|
|
ot_cpu.get_etape((char*)"generation_geometrie",temps_generation_geometrie); |
513 |
|
|
change_temps_geometrie(get_temps_geometrie()+temps_generation_geometrie); |
514 |
couturad |
919 |
generateur->construire(this); |
515 |
|
|
delete generateur; |
516 |
|
|
return OK; |
517 |
|
|
} |
518 |
|
|
|
519 |
couturad |
926 |
int MSTRUCT_VES::generer_materiau(std::vector< OT_PARAMETRES* >& vector_params_materiau) |
520 |
couturad |
919 |
{ |
521 |
|
|
OT_CPU ot_cpu; |
522 |
|
|
ot_cpu.initialise(); |
523 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
524 |
|
|
for(it=vector_params_materiau.begin();it!=vector_params_materiau.end();it++) |
525 |
|
|
{ |
526 |
|
|
OT_PARAMETRES* param = *it; |
527 |
|
|
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
528 |
couturad |
971 |
bool Etude_mecanique = (bool)param->get_valeur((char*)"Etude_mecanique"); |
529 |
|
|
if(Etude_mecanique) |
530 |
couturad |
919 |
{ |
531 |
couturad |
971 |
double Mu_E = param->get_valeur((char*)"Mu_E"); |
532 |
|
|
double Sigma_E = param->get_valeur((char*)"Sigma_E"); |
533 |
|
|
int Type_distribution_E = (int)param->get_valeur((char*)"Type_distribution_E"); |
534 |
|
|
double Mu_nu = param->get_valeur((char*)"Mu_nu"); |
535 |
|
|
double Sigma_nu = param->get_valeur((char*)"Sigma_nu"); |
536 |
|
|
int Type_distribution_nu = (int)param->get_valeur((char*)"Type_distribution_nu"); |
537 |
|
|
std::random_device seed; |
538 |
|
|
std::mt19937_64 generateur(seed()); |
539 |
|
|
std::uniform_real_distribution<double> uniform_distribution_E(Mu_E-Sigma_E,Mu_E+Sigma_E); |
540 |
|
|
std::normal_distribution<double> normal_distribution_E(Mu_E,Sigma_E); |
541 |
|
|
std::uniform_real_distribution<double> uniform_distribution_nu(Mu_nu-Sigma_nu,Mu_nu+Sigma_nu); |
542 |
|
|
std::normal_distribution<double> normal_distribution_nu(Mu_nu,Sigma_nu); |
543 |
|
|
MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme); |
544 |
|
|
std::map<long,MG_CG_FORME*>::iterator it_forme; |
545 |
|
|
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)) |
546 |
couturad |
919 |
{ |
547 |
couturad |
971 |
double E; |
548 |
|
|
if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::FIXE) E=Mu_E; |
549 |
|
|
else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) E=uniform_distribution_E(generateur); |
550 |
|
|
else if(Type_distribution_E==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) E=normal_distribution_E(generateur); |
551 |
|
|
double nu; |
552 |
|
|
if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::FIXE) nu=Mu_nu; |
553 |
|
|
else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) nu=uniform_distribution_nu(generateur); |
554 |
|
|
else if(Type_distribution_nu==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) nu=normal_distribution_nu(generateur); |
555 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
556 |
|
|
{ |
557 |
|
|
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
558 |
|
|
forme_volume->get_mg_volume()->ajouter_ccf((char*)"Em",E); |
559 |
|
|
forme_volume->get_mg_volume()->ajouter_ccf((char*)"nu",nu); |
560 |
|
|
} |
561 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
562 |
|
|
{ |
563 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
564 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
565 |
|
|
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)) |
566 |
|
|
{ |
567 |
|
|
volume->ajouter_ccf((char*)"Em",E); |
568 |
|
|
volume->ajouter_ccf((char*)"nu",nu); |
569 |
|
|
} |
570 |
|
|
} |
571 |
couturad |
919 |
} |
572 |
couturad |
971 |
} |
573 |
|
|
bool Etude_thermique = (bool)param->get_valeur((char*)"Etude_thermique"); |
574 |
|
|
if(Etude_thermique) |
575 |
|
|
{ |
576 |
|
|
double Mu_Lambda = param->get_valeur((char*)"Mu_Lambda"); |
577 |
|
|
double Sigma_Lambda = param->get_valeur((char*)"Sigma_Lambda"); |
578 |
|
|
int Type_distribution_Lambda = (int)param->get_valeur((char*)"Type_distribution_Lambda"); |
579 |
|
|
double Mu_Ro = param->get_valeur((char*)"Mu_Ro"); |
580 |
|
|
double Sigma_Ro = param->get_valeur((char*)"Sigma_Ro"); |
581 |
|
|
int Type_distribution_Ro = (int)param->get_valeur((char*)"Type_distribution_Ro"); |
582 |
|
|
double Mu_Cp = param->get_valeur((char*)"Mu_Cp"); |
583 |
|
|
double Sigma_Cp = param->get_valeur((char*)"Sigma_Cp"); |
584 |
|
|
int Type_distribution_Cp = (int)param->get_valeur((char*)"Type_distribution_Cp"); |
585 |
|
|
std::random_device seed; |
586 |
|
|
std::mt19937_64 generateur(seed()); |
587 |
|
|
std::uniform_real_distribution<double> uniform_distribution_Lambda(Mu_Lambda-Sigma_Lambda,Mu_Lambda+Sigma_Lambda); |
588 |
|
|
std::normal_distribution<double> normal_distribution_Lambda(Mu_Lambda,Sigma_Lambda); |
589 |
|
|
std::uniform_real_distribution<double> uniform_distribution_Ro(Mu_Ro-Sigma_Ro,Mu_Ro+Sigma_Ro); |
590 |
|
|
std::normal_distribution<double> normal_distribution_Ro(Mu_Ro,Sigma_Ro); |
591 |
|
|
std::uniform_real_distribution<double> uniform_distribution_Cp(Mu_Cp-Sigma_Cp,Mu_Cp+Sigma_Cp); |
592 |
|
|
std::normal_distribution<double> normal_distribution_Cp(Mu_Cp,Sigma_Cp); |
593 |
|
|
MG_CG_GROUPE_FORME* mgcg_groupe_forme = m_mgcg_modele->get_mgcg_groupe_forme(Nom_groupe_forme); |
594 |
|
|
std::map<long,MG_CG_FORME*>::iterator it_forme; |
595 |
|
|
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)) |
596 |
couturad |
919 |
{ |
597 |
couturad |
971 |
double Lambda; |
598 |
|
|
if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Lambda=Mu_Lambda; |
599 |
|
|
else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Lambda=uniform_distribution_Lambda(generateur); |
600 |
|
|
else if(Type_distribution_Lambda==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Lambda=normal_distribution_Lambda(generateur); |
601 |
|
|
double Ro; |
602 |
|
|
if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Ro=Mu_Ro; |
603 |
|
|
else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Ro=uniform_distribution_Ro(generateur); |
604 |
|
|
else if(Type_distribution_Ro==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Ro=normal_distribution_Ro(generateur); |
605 |
|
|
double Cp; |
606 |
|
|
if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::FIXE) Cp=Mu_Cp; |
607 |
|
|
else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::UNIFORME) Cp=uniform_distribution_Cp(generateur); |
608 |
|
|
else if(Type_distribution_Cp==MSTRUCT::TYPE_DISTRIBUTION::NORMALE) Cp=normal_distribution_Cp(generateur); |
609 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
610 |
|
|
{ |
611 |
|
|
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
612 |
|
|
forme_volume->get_mg_volume()->ajouter_ccf((char*)"Kx",Lambda); |
613 |
|
|
forme_volume->get_mg_volume()->ajouter_ccf((char*)"Ro",Ro); |
614 |
|
|
forme_volume->get_mg_volume()->ajouter_ccf((char*)"Cp",Cp); |
615 |
|
|
} |
616 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
617 |
|
|
{ |
618 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
619 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
620 |
|
|
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)) |
621 |
|
|
{ |
622 |
|
|
volume->ajouter_ccf((char*)"Kx",Lambda); |
623 |
|
|
volume->ajouter_ccf((char*)"Ro",Ro); |
624 |
|
|
volume->ajouter_ccf((char*)"Cp",Cp); |
625 |
|
|
} |
626 |
|
|
} |
627 |
couturad |
919 |
} |
628 |
|
|
} |
629 |
couturad |
971 |
} |
630 |
couturad |
919 |
ot_cpu.ajouter_etape((char*)"generation_materiau"); |
631 |
couturad |
926 |
double temps_generation_materiau; |
632 |
|
|
ot_cpu.get_etape((char*)"generation_materiau",temps_generation_materiau); |
633 |
|
|
change_temps_materiau(get_temps_materiau()+temps_generation_materiau); |
634 |
couturad |
919 |
return OK; |
635 |
|
|
} |
636 |
|
|
|
637 |
couturad |
926 |
int MSTRUCT_VES::generer_carte(OT_PARAMETRES *param) |
638 |
couturad |
919 |
{ |
639 |
|
|
double Ecart_nodal = param->get_valeur((char*)"Ecart_nodal"); |
640 |
couturad |
937 |
double Ecart_nodal_face_particule = param->get_valeur((char*)"Ecart_nodal_face_particule"); |
641 |
couturad |
919 |
double Fechantillonnage = param->get_valeur((char*)"Fechantillonnage"); |
642 |
|
|
double Nb_cellule_direction = param->get_valeur((char*)"Nb_cellule_direction"); |
643 |
|
|
std::string Nom_fem_solution = param->get_nom((char*)"Nom_fem_solution"); |
644 |
|
|
std::string Nom_mg_gestionnaire_carte = param->get_nom((char*)"Nom_mg_gestionnaire_carte"); |
645 |
|
|
std::string Nom_carte = param->get_nom((char*)"Nom_carte"); |
646 |
|
|
double Nb_couche_min = param->get_valeur((char*)"Nb_couche_min"); |
647 |
|
|
double Nb_pas = param->get_valeur((char*)"Nb_pas"); |
648 |
|
|
double Facteur_augmentation = param->get_valeur((char*)"Facteur_augmentation"); |
649 |
|
|
MG_GESTIONNAIRE *mggest_carte = new MG_GESTIONNAIRE; |
650 |
couturad |
926 |
MG_CG_GROUPE_FORME* mgcg_groupe_matrice = m_mgcg_modele->get_mgcg_groupe_forme((char*)"Matrice"); |
651 |
|
|
TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume_matrice = mgcg_groupe_matrice->get_tpl_map_volume(); |
652 |
couturad |
919 |
OT_CPU ot_cpu; |
653 |
|
|
ot_cpu.initialise(); |
654 |
|
|
FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE *carte = new FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(mggest_carte, |
655 |
|
|
m_mg_geometrie, |
656 |
|
|
Ecart_nodal, |
657 |
couturad |
937 |
Ecart_nodal_face_particule, |
658 |
couturad |
919 |
Fechantillonnage, |
659 |
|
|
Nb_cellule_direction, |
660 |
|
|
(char*)Nom_fem_solution.c_str(), |
661 |
|
|
tpl_map_volume_matrice, |
662 |
|
|
Nb_couche_min, |
663 |
|
|
Nb_pas, |
664 |
|
|
Facteur_augmentation); |
665 |
couturad |
926 |
|
666 |
|
|
|
667 |
couturad |
933 |
carte->active_affichage(fonc_affiche); |
668 |
couturad |
926 |
carte->construit(); |
669 |
couturad |
919 |
ot_cpu.ajouter_etape((char*)"generation_carte"); |
670 |
couturad |
926 |
double temps_generation_carte; |
671 |
|
|
ot_cpu.get_etape((char*)"generation_carte",temps_generation_carte); |
672 |
|
|
change_temps_carte(get_temps_carte()+temps_generation_carte); |
673 |
|
|
mggest_carte->enregistrer(Nom_mg_gestionnaire_carte.c_str()); |
674 |
couturad |
919 |
carte->enregistrer((char*)Nom_carte.c_str()); |
675 |
couturad |
964 |
char message[1000]; |
676 |
|
|
std::sprintf(message,"Fichier CARTE de sortie : %s",Nom_carte.c_str()); |
677 |
|
|
affiche(message); |
678 |
couturad |
926 |
m_ves_file->change_nom_fichier_carte((char*)Nom_carte.c_str()); |
679 |
couturad |
919 |
return OK; |
680 |
|
|
} |
681 |
|
|
|
682 |
couturad |
926 |
int MSTRUCT_VES::generer_maillage(OT_PARAMETRES *param,FCT_TAILLE_FEM_SOLUTION* carte) |
683 |
couturad |
919 |
{ |
684 |
|
|
OT_CPU ot_cpu; |
685 |
|
|
ot_cpu.initialise(); |
686 |
|
|
int Niveau = (int)param->get_valeur((char*)"Niveau"); |
687 |
|
|
int Niveau_opt_2d = (int)param->get_valeur((char*)"Niveau_opt_2d"); |
688 |
|
|
int Niveau_opt_3d = (int)param->get_valeur((char*)"Niveau_opt_3d"); |
689 |
|
|
double Priorite_metrique = param->get_valeur((char*)"Priorite_metrique"); |
690 |
|
|
int Analyse = (int)param->get_valeur((char*)"Analyse"); |
691 |
|
|
affiche((char*)"Maillage du VER :"); |
692 |
|
|
m_mg_maillage = new MG_MAILLAGE(m_mg_geometrie); |
693 |
|
|
m_mg_gestionnaire->ajouter_mg_maillage(m_mg_maillage); |
694 |
couturad |
951 |
change_mg_maillage(m_mg_maillage); |
695 |
|
|
affiche((char*)" Maillage 3D_couche :"); |
696 |
|
|
MAILLEUR3D_COUCHE m3d_couche(m_mg_maillage,m_mg_geometrie,carte); |
697 |
|
|
m3d_couche.active_affichage(fonc_affiche); |
698 |
|
|
LISTE_MG_VOLUME::iterator it_volume; |
699 |
|
|
for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume)) |
700 |
couturad |
919 |
{ |
701 |
couturad |
951 |
if(volume->est_mince()) |
702 |
|
|
{ |
703 |
|
|
char message[1000]; |
704 |
|
|
sprintf(message," -> Maillage du volume id %li",volume->get_id()); |
705 |
|
|
affiche(message); |
706 |
couturad |
966 |
if(m3d_couche.maille(volume)==FAIL) return FAIL; |
707 |
couturad |
951 |
} |
708 |
couturad |
919 |
} |
709 |
couturad |
951 |
if(Niveau>=0) |
710 |
couturad |
919 |
{ |
711 |
couturad |
951 |
MAILLEUR0D m0d(m_mg_maillage,m_mg_geometrie); |
712 |
|
|
affiche((char*)" Maillage 0D :"); |
713 |
|
|
LISTE_MG_SOMMET::iterator it_sommet; |
714 |
|
|
for(MG_SOMMET* sommet=m_mg_geometrie->get_premier_sommet(it_sommet);sommet!=NULL;sommet=m_mg_geometrie->get_suivant_sommet(it_sommet)) |
715 |
|
|
{ |
716 |
|
|
if(sommet->get_lien_maillage()->get_nb()>0) continue; |
717 |
|
|
char message[1000]; |
718 |
|
|
sprintf(message," -> Maillage du sommet id %li",sommet->get_id()); |
719 |
|
|
affiche(message); |
720 |
couturad |
966 |
if(m0d.maille(sommet)==FAIL) return FAIL; |
721 |
couturad |
951 |
} |
722 |
couturad |
919 |
} |
723 |
couturad |
951 |
if(Niveau>=1) |
724 |
couturad |
919 |
{ |
725 |
couturad |
951 |
MAILLEUR1D m1d(m_mg_maillage,m_mg_geometrie,carte); |
726 |
|
|
affiche((char*)" Maillage 1D :"); |
727 |
|
|
m1d.active_affichage(fonc_affiche); |
728 |
|
|
LISTE_MG_ARETE::iterator it_arete; |
729 |
|
|
for(MG_ARETE* arete=m_mg_geometrie->get_premier_arete(it_arete);arete!=NULL;arete=m_mg_geometrie->get_suivant_arete(it_arete)) |
730 |
|
|
{ |
731 |
|
|
if(arete->get_lien_maillage()->get_nb()>0) continue; |
732 |
|
|
char message[1000]; |
733 |
|
|
sprintf(message," -> Maillage de l'arete id %li",arete->get_id()); |
734 |
|
|
affiche(message); |
735 |
couturad |
966 |
if(m1d.maille(arete)==FAIL) return FAIL; |
736 |
couturad |
951 |
} |
737 |
couturad |
919 |
} |
738 |
couturad |
951 |
if(Niveau>=2) |
739 |
couturad |
919 |
{ |
740 |
couturad |
951 |
MAILLEUR2D m2d(m_mg_maillage,m_mg_geometrie,carte); |
741 |
|
|
m2d.change_niveau_optimisation(Niveau_opt_2d); |
742 |
|
|
m2d.change_priorite_metrique(Priorite_metrique); |
743 |
|
|
affiche((char*)" Maillage 2D :"); |
744 |
|
|
m2d.active_affichage(fonc_affiche); |
745 |
|
|
LISTE_MG_FACE::iterator it_face; |
746 |
|
|
for(MG_FACE* face=m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face)) |
747 |
|
|
{ |
748 |
|
|
if(face->get_lien_maillage()->get_nb()>0) continue; |
749 |
|
|
char message[1000]; |
750 |
|
|
sprintf(message," -> Maillage de la face id %li",face->get_id()); |
751 |
|
|
affiche(message); |
752 |
couturad |
966 |
if(m2d.maille(face)==FAIL) return FAIL; |
753 |
couturad |
951 |
} |
754 |
couturad |
919 |
} |
755 |
couturad |
951 |
if(Niveau>=3) |
756 |
|
|
{ |
757 |
|
|
MAILLEUR3D m3d(m_mg_maillage,m_mg_geometrie,carte,false); |
758 |
|
|
m3d.change_niveau_optimisation(Niveau_opt_3d); |
759 |
|
|
m3d.change_priorite_metrique(Priorite_metrique); |
760 |
|
|
affiche((char*)" Maillage 3D :"); |
761 |
|
|
m3d.active_affichage(fonc_affiche); |
762 |
|
|
for(MG_VOLUME* volume=m_mg_geometrie->get_premier_volume(it_volume);volume!=NULL;volume=m_mg_geometrie->get_suivant_volume(it_volume)) |
763 |
|
|
{ |
764 |
|
|
if(volume->get_lien_maillage()->get_nb()>0) continue; |
765 |
|
|
if(volume->est_mince()) continue; |
766 |
|
|
char message[1000]; |
767 |
|
|
sprintf(message," -> Maillage du volume id %li",volume->get_id()); |
768 |
|
|
affiche(message); |
769 |
couturad |
966 |
if(m3d.maille(volume)==FAIL) return FAIL; |
770 |
couturad |
951 |
} |
771 |
|
|
} |
772 |
couturad |
919 |
ot_cpu.ajouter_etape((char*)"generation_maillage"); |
773 |
couturad |
926 |
double temps_generation_maillage; |
774 |
|
|
ot_cpu.get_etape((char*)"generation_maillage",temps_generation_maillage); |
775 |
|
|
change_temps_maillage(get_temps_maillage()+temps_generation_maillage); |
776 |
couturad |
919 |
return OK; |
777 |
|
|
} |
778 |
|
|
|
779 |
couturad |
926 |
int MSTRUCT_VES::generer_fem_maillage(OT_PARAMETRES *param) |
780 |
couturad |
919 |
{ |
781 |
|
|
OT_CPU ot_cpu; |
782 |
|
|
ot_cpu.initialise(); |
783 |
|
|
int Degre = (int)param->get_valeur((char*)"Degre"); |
784 |
|
|
int Analyse = (int)param->get_valeur((char*)"Analyse"); |
785 |
|
|
int Optimisation_num_noeud = (int)param->get_valeur((char*)"Optimisation_num_noeud"); |
786 |
|
|
MAILLEUR_FEM mailleurfem; |
787 |
|
|
mailleurfem.active_affichage(fonc_affiche); |
788 |
couturad |
926 |
m_fem_maillage = new FEM_MAILLAGE(m_mg_maillage->get_mg_geometrie(),m_mg_maillage,Degre); |
789 |
couturad |
919 |
m_mg_gestionnaire->ajouter_fem_maillage(m_fem_maillage); |
790 |
couturad |
926 |
change_fem_maillage(m_fem_maillage); |
791 |
couturad |
966 |
if(Optimisation_num_noeud) {if(mailleurfem.maille(m_fem_maillage,1)==FAIL) return FAIL;} |
792 |
|
|
else {if(mailleurfem.maille(m_fem_maillage,0)==FAIL) return FAIL;}; |
793 |
couturad |
919 |
if(Analyse) |
794 |
|
|
{ |
795 |
|
|
MAILLEUR_ANALYSE m3d(m_fem_maillage); |
796 |
|
|
m3d.active_affichage(fonc_affiche); |
797 |
|
|
// m3d.analyse(); |
798 |
|
|
} |
799 |
|
|
ot_cpu.ajouter_etape((char*)"generation_fem_maillage"); |
800 |
couturad |
926 |
double temps_generation_fem_maillage; |
801 |
|
|
ot_cpu.get_etape((char*)"generation_fem_maillage",temps_generation_fem_maillage); |
802 |
|
|
change_temps_fem_maillage(get_temps_fem_maillage()+temps_generation_fem_maillage); |
803 |
couturad |
919 |
return OK; |
804 |
|
|
} |
805 |
|
|
|
806 |
couturad |
926 |
int MSTRUCT_VES::generer_etude(OT_PARAMETRES *param) |
807 |
couturad |
919 |
{ |
808 |
|
|
OT_CPU ot_cpu; |
809 |
|
|
ot_cpu.initialise(); |
810 |
couturad |
926 |
BOITE_3D boite3D_ves = get_boite3d_ves(); |
811 |
|
|
double eps = get_precision(); |
812 |
couturad |
982 |
int Type_etude = (int)param->get_valeur((char*)"Type_etude"); |
813 |
|
|
int Type_Chargement = (int)param->get_valeur((char*)"Type_Chargement"); |
814 |
|
|
int Type_CL = (int)param->get_valeur((char*)"Type_CL"); |
815 |
|
|
double Valeur_CL = param->get_valeur((char*)"Valeur_CL"); |
816 |
|
|
int Direction = (int)param->get_valeur((char*)"Direction"); |
817 |
|
|
MSTRUCT_OUTILS::appliquer_conditions_limites(m_mg_geometrie,boite3D_ves,Type_etude,Type_CL,Type_Chargement,Valeur_CL,Direction,eps); |
818 |
couturad |
919 |
ot_cpu.ajouter_etape((char*)"generation_etude"); |
819 |
couturad |
926 |
double temps_generation_etude; |
820 |
|
|
ot_cpu.get_etape((char*)"generation_etude",temps_generation_etude); |
821 |
|
|
change_temps_etude(get_temps_etude()+temps_generation_etude); |
822 |
couturad |
919 |
return OK; |
823 |
|
|
} |
824 |
|
|
|
825 |
couturad |
968 |
int MSTRUCT_VES::generer_calcul(OT_PARAMETRES *param,char* param_aster,std::string nom_etude) |
826 |
couturad |
919 |
{ |
827 |
|
|
int Type_etude = (int)param->get_valeur((char*)"Type_etude"); |
828 |
couturad |
971 |
int Type_calcul; |
829 |
|
|
if(Type_etude==MSTRUCT::TYPE_ETUDE::MECANIQUE) Type_calcul=MAGIC::CALCUL_ASTER::ELASTIQUE; |
830 |
|
|
else if(Type_etude==MSTRUCT::TYPE_ETUDE::THERMIQUE) Type_calcul=MAGIC::CALCUL_ASTER::THERMIQUE; |
831 |
couturad |
919 |
std::string Code_resu = param->get_nom((char*)"Code_resu"); |
832 |
|
|
MGASTER mgaster; |
833 |
|
|
mgaster.active_affichage(fonc_affiche); |
834 |
|
|
OT_CPU ot_cpu; |
835 |
|
|
ot_cpu.initialise(); |
836 |
couturad |
968 |
mgaster.calcule(param_aster,m_fem_maillage,(char*)nom_etude.c_str(),Type_calcul,(char*)Code_resu.c_str()); |
837 |
couturad |
919 |
ot_cpu.ajouter_etape((char*)"calcul"); |
838 |
couturad |
926 |
double temps_calcul; |
839 |
|
|
ot_cpu.get_etape((char*)"calcul",temps_calcul); |
840 |
|
|
change_temps_calcul(get_temps_calcul()+temps_calcul); |
841 |
couturad |
919 |
} |
842 |
|
|
|
843 |
couturad |
968 |
int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement) |
844 |
couturad |
919 |
{ |
845 |
couturad |
926 |
OT_CPU ot_cpu; |
846 |
|
|
ot_cpu.initialise(); |
847 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
848 |
couturad |
968 |
char ligne[1000]; |
849 |
|
|
for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++) |
850 |
couturad |
919 |
{ |
851 |
couturad |
926 |
OT_PARAMETRES* param = *it; |
852 |
couturad |
968 |
int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement"); |
853 |
couturad |
926 |
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
854 |
|
|
if(get_analyse(Identifiant)!=NULL) |
855 |
|
|
{ |
856 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl; |
857 |
|
|
continue; |
858 |
|
|
} |
859 |
|
|
sprintf(ligne,"-> %s",Identifiant.c_str()); |
860 |
|
|
affiche(ligne); |
861 |
couturad |
968 |
if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP) |
862 |
couturad |
926 |
{ |
863 |
|
|
long Num_solution = (long)param->get_valeur((char*)"Num_solution"); |
864 |
couturad |
968 |
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
865 |
|
|
double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution"); |
866 |
|
|
BOITE_3D *boite_3d_analyse=NULL; |
867 |
|
|
int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse"); |
868 |
|
|
if(Boite_analyse) |
869 |
|
|
{ |
870 |
|
|
double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin"); |
871 |
|
|
double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin"); |
872 |
|
|
double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin"); |
873 |
|
|
double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax"); |
874 |
|
|
double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax"); |
875 |
|
|
double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax"); |
876 |
|
|
boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); |
877 |
|
|
} |
878 |
|
|
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
879 |
couturad |
926 |
FEM_SOLUTION* sol = m_mg_gestionnaire->get_fem_solution(Num_solution); |
880 |
|
|
int nb_champ = sol->get_nb_champ(); |
881 |
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); |
882 |
|
|
if(Analyse_erosion) |
883 |
couturad |
930 |
{ |
884 |
couturad |
968 |
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
885 |
|
|
double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche"); |
886 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_champ,Nb_couche,Epaisseur_couche); |
887 |
|
|
analyse_erosion->executer(); |
888 |
|
|
ajouter_analyse(analyse_erosion); |
889 |
couturad |
930 |
} |
890 |
|
|
else |
891 |
|
|
{ |
892 |
couturad |
968 |
analyse_champ->executer(); |
893 |
|
|
ajouter_analyse(analyse_champ); |
894 |
couturad |
930 |
} |
895 |
couturad |
968 |
if(boite_3d_analyse!=NULL) delete boite_3d_analyse; |
896 |
|
|
} |
897 |
|
|
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION) |
898 |
couturad |
926 |
{ |
899 |
couturad |
968 |
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
900 |
|
|
int Avec_fem_maillage = (int)param->get_valeur((char*)"Avec_fem_maillage"); |
901 |
|
|
BOITE_3D *boite_3d_analyse=NULL; |
902 |
|
|
int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse"); |
903 |
|
|
if(Boite_analyse) |
904 |
couturad |
930 |
{ |
905 |
couturad |
968 |
double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin"); |
906 |
|
|
double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin"); |
907 |
|
|
double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin"); |
908 |
|
|
double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax"); |
909 |
|
|
double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax"); |
910 |
|
|
double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax"); |
911 |
|
|
boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); |
912 |
couturad |
930 |
} |
913 |
couturad |
968 |
MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = new MSTRUCT_ANALYSE_ORIENTATION(this,Identifiant,Nom_groupe_forme,boite_3d_analyse,Avec_fem_maillage); |
914 |
|
|
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
915 |
|
|
if(Analyse_erosion) |
916 |
couturad |
930 |
{ |
917 |
couturad |
968 |
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
918 |
|
|
double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche"); |
919 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_orientation,Nb_couche,Epaisseur_couche); |
920 |
|
|
analyse_erosion->executer(); |
921 |
|
|
ajouter_analyse(analyse_erosion); |
922 |
couturad |
930 |
} |
923 |
couturad |
938 |
else |
924 |
|
|
{ |
925 |
couturad |
968 |
analyse_orientation->executer(); |
926 |
|
|
ajouter_analyse(analyse_orientation); |
927 |
couturad |
938 |
} |
928 |
couturad |
968 |
if(boite_3d_analyse!=NULL) delete boite_3d_analyse; |
929 |
couturad |
938 |
} |
930 |
couturad |
968 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CAO) |
931 |
couturad |
926 |
{ |
932 |
couturad |
968 |
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
933 |
couturad |
926 |
double Largeur_colonne_distribution_volume_forme = (double)param->get_valeur((char*)"Largeur_colonne_distribution_volume_forme"); |
934 |
couturad |
968 |
MSTRUCT_ANALYSE_CAO* analyse_cao = new MSTRUCT_ANALYSE_CAO(this,Identifiant,Largeur_colonne_distribution_volume_forme,Nom_groupe_forme); |
935 |
|
|
analyse_cao->executer(); |
936 |
|
|
ajouter_analyse(analyse_cao); |
937 |
couturad |
926 |
} |
938 |
couturad |
971 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_PROPRIETE_MASSIQUE) |
939 |
|
|
{ |
940 |
|
|
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
941 |
|
|
MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE* analyse_prop_mass = new MSTRUCT_ANALYSE_PROPRIETE_MASSIQUE(this,Identifiant,Nom_groupe_forme); |
942 |
|
|
analyse_prop_mass->executer(); |
943 |
|
|
ajouter_analyse(analyse_prop_mass); |
944 |
|
|
} |
945 |
couturad |
968 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_MG) |
946 |
couturad |
926 |
{ |
947 |
couturad |
968 |
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
948 |
couturad |
926 |
double Largeur_colonne_distribution_qualite_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_2D"); |
949 |
|
|
double Largeur_colonne_distribution_qualite_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_qualite_3D"); |
950 |
|
|
double Largeur_colonne_distribution_taille_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_2D"); |
951 |
|
|
double Largeur_colonne_distribution_taille_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_taille_3D"); |
952 |
couturad |
968 |
BOITE_3D *boite_3d_analyse=NULL; |
953 |
|
|
int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse"); |
954 |
|
|
if(Boite_analyse) |
955 |
couturad |
930 |
{ |
956 |
couturad |
968 |
double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin"); |
957 |
|
|
double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin"); |
958 |
|
|
double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin"); |
959 |
|
|
double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax"); |
960 |
|
|
double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax"); |
961 |
|
|
double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax"); |
962 |
|
|
boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); |
963 |
couturad |
930 |
} |
964 |
couturad |
968 |
MSTRUCT_ANALYSE_MG_MAILLAGE* analyse_mg_maillage = new MSTRUCT_ANALYSE_MG_MAILLAGE(this, |
965 |
|
|
Identifiant, |
966 |
|
|
m_mg_maillage->get_id(), |
967 |
|
|
Largeur_colonne_distribution_qualite_2D, |
968 |
|
|
Largeur_colonne_distribution_taille_2D, |
969 |
|
|
Largeur_colonne_distribution_qualite_3D, |
970 |
|
|
Largeur_colonne_distribution_taille_3D, |
971 |
|
|
Nom_groupe_forme,boite_3d_analyse); |
972 |
|
|
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
973 |
|
|
if(Analyse_erosion) |
974 |
|
|
{ |
975 |
|
|
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
976 |
|
|
double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche"); |
977 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_mg_maillage,Nb_couche,Epaisseur_couche); |
978 |
|
|
analyse_erosion->executer(); |
979 |
|
|
ajouter_analyse(analyse_erosion); |
980 |
|
|
} |
981 |
couturad |
930 |
else |
982 |
|
|
{ |
983 |
couturad |
968 |
analyse_mg_maillage->executer(); |
984 |
|
|
ajouter_analyse(analyse_mg_maillage); |
985 |
couturad |
930 |
} |
986 |
couturad |
968 |
if(boite_3d_analyse!=NULL) delete boite_3d_analyse; |
987 |
couturad |
926 |
} |
988 |
couturad |
968 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MAILLAGE_FEM) |
989 |
couturad |
926 |
{ |
990 |
couturad |
968 |
std::string Nom_groupe_forme = param->get_nom((char*)"Nom_groupe_forme"); |
991 |
couturad |
926 |
double Largeur_colonne_distribution_jacobien_2D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_min"); |
992 |
|
|
double Largeur_colonne_distribution_jacobien_2D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_2D_max"); |
993 |
|
|
double Largeur_colonne_distribution_jacobien_3D_min = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_min"); |
994 |
|
|
double Largeur_colonne_distribution_jacobien_3D_max = (double)param->get_valeur((char*)"Largeur_colonne_distribution_jacobien_3D_max"); |
995 |
|
|
double Largeur_colonne_distribution_distortion_2D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_2D"); |
996 |
|
|
double Largeur_colonne_distribution_distortion_3D = (double)param->get_valeur((char*)"Largeur_colonne_distribution_distortion_3D"); |
997 |
couturad |
968 |
BOITE_3D *boite_3d_analyse=NULL; |
998 |
|
|
int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse"); |
999 |
|
|
if(Boite_analyse) |
1000 |
|
|
{ |
1001 |
|
|
double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin"); |
1002 |
|
|
double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin"); |
1003 |
|
|
double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin"); |
1004 |
|
|
double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax"); |
1005 |
|
|
double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax"); |
1006 |
|
|
double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax"); |
1007 |
|
|
boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); |
1008 |
|
|
} |
1009 |
|
|
MSTRUCT_ANALYSE_FEM_MAILLAGE* analyse_maillage_fem = new MSTRUCT_ANALYSE_FEM_MAILLAGE(this, |
1010 |
|
|
Identifiant, |
1011 |
couturad |
926 |
m_fem_maillage->get_id(), |
1012 |
|
|
Largeur_colonne_distribution_jacobien_2D_min, |
1013 |
|
|
Largeur_colonne_distribution_jacobien_2D_max, |
1014 |
|
|
Largeur_colonne_distribution_jacobien_3D_min, |
1015 |
|
|
Largeur_colonne_distribution_jacobien_3D_max, |
1016 |
|
|
Largeur_colonne_distribution_distortion_2D, |
1017 |
|
|
Largeur_colonne_distribution_distortion_3D, |
1018 |
|
|
Nom_groupe_forme, |
1019 |
|
|
boite_3d_analyse); |
1020 |
couturad |
968 |
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
1021 |
|
|
if(Analyse_erosion) |
1022 |
couturad |
930 |
{ |
1023 |
couturad |
968 |
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
1024 |
|
|
double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche"); |
1025 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_maillage_fem,Nb_couche,Epaisseur_couche); |
1026 |
|
|
analyse_erosion->executer(); |
1027 |
|
|
ajouter_analyse(analyse_erosion); |
1028 |
couturad |
930 |
} |
1029 |
|
|
else |
1030 |
|
|
{ |
1031 |
couturad |
968 |
analyse_maillage_fem->executer(); |
1032 |
|
|
ajouter_analyse(analyse_maillage_fem); |
1033 |
couturad |
930 |
} |
1034 |
couturad |
968 |
if(boite_3d_analyse!=NULL) delete boite_3d_analyse; |
1035 |
couturad |
926 |
} |
1036 |
couturad |
968 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_NORMALISE) |
1037 |
|
|
{ |
1038 |
|
|
std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ"); |
1039 |
couturad |
982 |
std::string Identifiant_champ_reference = param->get_nom((char*)"Identifiant_champ_reference"); |
1040 |
couturad |
968 |
double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution"); |
1041 |
|
|
if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1042 |
|
|
{ |
1043 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ); |
1044 |
couturad |
982 |
MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ_reference); |
1045 |
|
|
double valeur_ref=0.0; |
1046 |
|
|
int nb_champ=analyse_champ_reference->get_nb_champ(); |
1047 |
|
|
for(int i=0;i<nb_champ;i++) if(abs(analyse_champ_reference->get_moyenne()[i])>valeur_ref) valeur_ref=abs(analyse_champ_reference->get_moyenne()[i]); |
1048 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution); |
1049 |
couturad |
968 |
ajouter_analyse(analyse_normalise); |
1050 |
|
|
} |
1051 |
|
|
else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1052 |
|
|
{ |
1053 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ); |
1054 |
|
|
double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche(); |
1055 |
|
|
std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme(); |
1056 |
|
|
BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse(); |
1057 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_normalise = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1058 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion; |
1059 |
couturad |
982 |
int k=0; |
1060 |
|
|
double valeur_ref=0.0; |
1061 |
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)) |
1062 |
|
|
{ |
1063 |
couturad |
982 |
if(k==0) |
1064 |
|
|
{ |
1065 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion_reference; |
1066 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ_reference = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ_reference); |
1067 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ_reference = (MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_champ_reference->get_premiere_analyse(it_analyse_erosion_reference); |
1068 |
|
|
int nb_champ=analyse_champ_reference->get_nb_champ(); |
1069 |
|
|
for(int i=0;i<nb_champ;i++) if(abs(analyse_champ_reference->get_moyenne()[i])>valeur_ref) valeur_ref=abs(analyse_champ_reference->get_moyenne()[i]); |
1070 |
|
|
} |
1071 |
couturad |
968 |
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse; |
1072 |
couturad |
982 |
MSTRUCT_ANALYSE_CHAMP* analyse_normalise = analyse_champ->normaliser(Identifiant,valeur_ref,Largeur_colonne_distribution); |
1073 |
couturad |
968 |
analyse_erosion_normalise->ajouter_analyse(analyse_normalise); |
1074 |
couturad |
982 |
k++; |
1075 |
couturad |
968 |
} |
1076 |
|
|
ajouter_analyse(analyse_erosion_normalise); |
1077 |
|
|
} |
1078 |
|
|
} |
1079 |
|
|
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART) |
1080 |
|
|
{ |
1081 |
|
|
std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ"); |
1082 |
|
|
if(get_analyse(Identifiant_champ)==NULL) |
1083 |
|
|
{ |
1084 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl; |
1085 |
|
|
return FAIL; |
1086 |
|
|
} |
1087 |
|
|
std::string Identifiant_champ_compare = param->get_nom((char*)"Identifiant_champ_compare"); |
1088 |
|
|
if(get_analyse(Identifiant_champ_compare)==NULL) |
1089 |
|
|
{ |
1090 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl; |
1091 |
|
|
return FAIL; |
1092 |
|
|
} |
1093 |
|
|
double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution"); |
1094 |
|
|
int Type_ecart = (int)param->get_valeur((char*)"Type_ecart"); |
1095 |
|
|
if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1096 |
|
|
{ |
1097 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ); |
1098 |
|
|
MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare); |
1099 |
|
|
if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1100 |
|
|
{ |
1101 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare; |
1102 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart); |
1103 |
|
|
ajouter_analyse(analyse_ecart); |
1104 |
|
|
} |
1105 |
|
|
else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1106 |
|
|
{ |
1107 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare; |
1108 |
|
|
int Num_couche = (int)param->get_valeur((char*)"Num_couche"); |
1109 |
|
|
if(Num_couche>=0) |
1110 |
|
|
{ |
1111 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche); |
1112 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart); |
1113 |
|
|
ajouter_analyse(analyse_ecart); |
1114 |
|
|
} |
1115 |
|
|
else |
1116 |
|
|
{ |
1117 |
|
|
double epaisseur_couche = analyse_erosion_compare->get_epaisseur_couche(); |
1118 |
|
|
std::string Nom_groupe_forme = analyse_erosion_compare->get_nom_groupe_forme(); |
1119 |
|
|
BOITE_3D *boite_3d_analyse=analyse_erosion_compare->get_boite_analyse(); |
1120 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1121 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion; |
1122 |
|
|
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)) |
1123 |
|
|
{ |
1124 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,(MSTRUCT_ANALYSE_CHAMP*)analyse_champ_compare,Type_ecart); |
1125 |
|
|
analyse_erosion_ecart->ajouter_analyse(analyse_ecart); |
1126 |
|
|
} |
1127 |
|
|
ajouter_analyse(analyse_erosion_ecart); |
1128 |
|
|
} |
1129 |
|
|
|
1130 |
|
|
} |
1131 |
|
|
} |
1132 |
|
|
else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1133 |
|
|
{ |
1134 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ); |
1135 |
|
|
double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche(); |
1136 |
|
|
std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme(); |
1137 |
|
|
BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse(); |
1138 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1139 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion; |
1140 |
|
|
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)) |
1141 |
|
|
{ |
1142 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse; |
1143 |
|
|
MSTRUCT_ANALYSE* analyse_compare = get_analyse(Identifiant_champ_compare); |
1144 |
|
|
if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1145 |
|
|
{ |
1146 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare = (MSTRUCT_ANALYSE_CHAMP*)analyse_compare; |
1147 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart); |
1148 |
|
|
analyse_erosion_ecart->ajouter_analyse(analyse_ecart); |
1149 |
|
|
} |
1150 |
|
|
else if(analyse_compare->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1151 |
|
|
{ |
1152 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_compare = (MSTRUCT_ANALYSE_EROSION*)analyse_compare; |
1153 |
|
|
int Num_couche = (int)param->get_valeur((char*)"Num_couche"); |
1154 |
|
|
if(Num_couche>=0) |
1155 |
|
|
{ |
1156 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ_compare=(MSTRUCT_ANALYSE_CHAMP*)analyse_erosion_compare->get_analyse(Num_couche); |
1157 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart(Identifiant,Largeur_colonne_distribution,analyse_champ_compare,Type_ecart); |
1158 |
|
|
analyse_erosion_ecart->ajouter_analyse(analyse_ecart); |
1159 |
|
|
} |
1160 |
|
|
else |
1161 |
|
|
{ |
1162 |
|
|
|
1163 |
|
|
} |
1164 |
|
|
|
1165 |
|
|
} |
1166 |
|
|
} |
1167 |
|
|
ajouter_analyse(analyse_erosion_ecart); |
1168 |
|
|
} |
1169 |
|
|
} |
1170 |
|
|
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CHAMP_ECART_CHARGEMENT) |
1171 |
|
|
{ |
1172 |
|
|
std::string Identifiant_champ = param->get_nom((char*)"Identifiant_champ"); |
1173 |
|
|
if(get_analyse(Identifiant_champ)==NULL) |
1174 |
|
|
{ |
1175 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl; |
1176 |
|
|
return FAIL; |
1177 |
|
|
} |
1178 |
|
|
double Largeur_colonne_distribution = (double)param->get_valeur((char*)"Largeur_colonne_distribution"); |
1179 |
|
|
int Type_chargement = (int)param->get_valeur((char*)"Type_chargement"); |
1180 |
|
|
int Type_ecart = (int)param->get_valeur((char*)"Type_ecart"); |
1181 |
|
|
if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1182 |
|
|
{ |
1183 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)get_analyse(Identifiant_champ); |
1184 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart); |
1185 |
|
|
ajouter_analyse(analyse_ecart); |
1186 |
|
|
} |
1187 |
|
|
else if(get_analyse(Identifiant_champ)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1188 |
|
|
{ |
1189 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_champ = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_champ); |
1190 |
|
|
double epaisseur_couche = analyse_erosion_champ->get_epaisseur_couche(); |
1191 |
|
|
std::string Nom_groupe_forme = analyse_erosion_champ->get_nom_groupe_forme(); |
1192 |
|
|
BOITE_3D *boite_3d_analyse=analyse_erosion_champ->get_boite_analyse(); |
1193 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1194 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion; |
1195 |
|
|
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)) |
1196 |
|
|
{ |
1197 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_champ = (MSTRUCT_ANALYSE_CHAMP*)analyse; |
1198 |
|
|
MSTRUCT_ANALYSE_CHAMP* analyse_ecart = analyse_champ->calculer_ecart_chargement(Identifiant,Largeur_colonne_distribution,Type_chargement,Type_ecart); |
1199 |
|
|
analyse_erosion_ecart->ajouter_analyse(analyse_ecart); |
1200 |
|
|
} |
1201 |
|
|
ajouter_analyse(analyse_erosion_ecart); |
1202 |
|
|
} |
1203 |
|
|
} |
1204 |
|
|
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_ORIENTATION_ECART) |
1205 |
|
|
{ |
1206 |
|
|
std::string Identifiant_orientation = param->get_nom((char*)"Identifiant_orientation"); |
1207 |
|
|
if(get_analyse(Identifiant_orientation)==NULL) |
1208 |
|
|
{ |
1209 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] inexistante ***" << std::endl; |
1210 |
|
|
return FAIL; |
1211 |
|
|
} |
1212 |
|
|
int Type_ecart = (int)param->get_valeur((char*)"Type_ecart"); |
1213 |
|
|
double tenseur_compare[6]; |
1214 |
|
|
tenseur_compare[0] = (double)param->get_valeur((char*)"a_11"); |
1215 |
|
|
tenseur_compare[1] = (double)param->get_valeur((char*)"a_22"); |
1216 |
|
|
tenseur_compare[2] = (double)param->get_valeur((char*)"a_33"); |
1217 |
|
|
tenseur_compare[3] = (double)param->get_valeur((char*)"a_12"); |
1218 |
|
|
tenseur_compare[4] = (double)param->get_valeur((char*)"a_23"); |
1219 |
|
|
tenseur_compare[5] = (double)param->get_valeur((char*)"a_13"); |
1220 |
|
|
if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::ORIENTATION) |
1221 |
|
|
{ |
1222 |
|
|
MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)get_analyse(Identifiant_orientation); |
1223 |
|
|
MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart); |
1224 |
|
|
ajouter_analyse(analyse_compare); |
1225 |
|
|
} |
1226 |
|
|
else if(get_analyse(Identifiant_orientation)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1227 |
|
|
{ |
1228 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_orientation = (MSTRUCT_ANALYSE_EROSION*)get_analyse(Identifiant_orientation); |
1229 |
|
|
double epaisseur_couche = analyse_erosion_orientation->get_epaisseur_couche(); |
1230 |
|
|
std::string Nom_groupe_forme = analyse_erosion_orientation->get_nom_groupe_forme(); |
1231 |
|
|
BOITE_3D *boite_3d_analyse=analyse_erosion_orientation->get_boite_analyse(); |
1232 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion_ecart = new MSTRUCT_ANALYSE_EROSION(Identifiant,epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1233 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_erosion; |
1234 |
|
|
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)) |
1235 |
|
|
{ |
1236 |
|
|
MSTRUCT_ANALYSE_ORIENTATION* analyse_orientation = (MSTRUCT_ANALYSE_ORIENTATION*)analyse; |
1237 |
|
|
MSTRUCT_ANALYSE_ORIENTATION* analyse_compare = analyse_orientation->calculer_ecart(Identifiant,tenseur_compare,Type_ecart); |
1238 |
|
|
analyse_erosion_ecart->ajouter_analyse(analyse_compare); |
1239 |
|
|
} |
1240 |
|
|
ajouter_analyse(analyse_erosion_ecart); |
1241 |
|
|
} |
1242 |
|
|
} |
1243 |
couturad |
971 |
else if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE) |
1244 |
|
|
{ |
1245 |
couturad |
982 |
long Num_solution_temp=(long)param->get_valeur((char*)"Num_solution_temp"); |
1246 |
|
|
long Num_solution_flux=(long)param->get_valeur((char*)"Num_solution_flux"); |
1247 |
|
|
int Direction=(int)param->get_valeur((char*)"Direction"); |
1248 |
|
|
BOITE_3D *boite_3d_analyse=NULL; |
1249 |
|
|
int Boite_analyse = (int)param->get_valeur((char*)"Boite_analyse"); |
1250 |
|
|
if(Boite_analyse) |
1251 |
couturad |
971 |
{ |
1252 |
couturad |
982 |
double Xmin = (double)param->get_valeur((char*)"Boite3D_analyse_Xmin"); |
1253 |
|
|
double Ymin = (double)param->get_valeur((char*)"Boite3D_analyse_Ymin"); |
1254 |
|
|
double Zmin = (double)param->get_valeur((char*)"Boite3D_analyse_Zmin"); |
1255 |
|
|
double Xmax = (double)param->get_valeur((char*)"Boite3D_analyse_Xmax"); |
1256 |
|
|
double Ymax = (double)param->get_valeur((char*)"Boite3D_analyse_Ymax"); |
1257 |
|
|
double Zmax = (double)param->get_valeur((char*)"Boite3D_analyse_Zmax"); |
1258 |
|
|
boite_3d_analyse = new BOITE_3D(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); |
1259 |
couturad |
971 |
} |
1260 |
couturad |
982 |
int Analyse_erosion = (int)param->get_valeur((char*)"Analyse_erosion"); |
1261 |
|
|
FEM_SOLUTION * fem_sol_temp=get_mg_gestionnaire()->get_fem_solution(Num_solution_temp); |
1262 |
|
|
FEM_SOLUTION * fem_sol_flux=get_mg_gestionnaire()->get_fem_solution(Num_solution_flux); |
1263 |
|
|
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); |
1264 |
|
|
if(Analyse_erosion) |
1265 |
couturad |
971 |
{ |
1266 |
couturad |
982 |
long Nb_couche = (long)param->get_valeur((char*)"Nb_couche"); |
1267 |
|
|
double Epaisseur_couche = (double)param->get_valeur((char*)"Epaisseur_couche"); |
1268 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,analyse_cond_ther,Nb_couche,Epaisseur_couche); |
1269 |
|
|
analyse_erosion->executer(); |
1270 |
|
|
ajouter_analyse(analyse_erosion); |
1271 |
couturad |
971 |
} |
1272 |
|
|
else |
1273 |
|
|
{ |
1274 |
couturad |
982 |
analyse_cond_ther->executer(); |
1275 |
|
|
ajouter_analyse(analyse_cond_ther); |
1276 |
couturad |
971 |
} |
1277 |
couturad |
982 |
if(boite_3d_analyse!=NULL) delete boite_3d_analyse; |
1278 |
couturad |
971 |
} |
1279 |
couturad |
968 |
else |
1280 |
|
|
{ |
1281 |
|
|
sprintf(ligne,"ERREUR -> %s",Identifiant.c_str()); |
1282 |
|
|
affiche(ligne); |
1283 |
|
|
} |
1284 |
couturad |
919 |
} |
1285 |
couturad |
926 |
ot_cpu.ajouter_etape((char*)"analyse"); |
1286 |
|
|
double temps_analyse; |
1287 |
|
|
ot_cpu.get_etape((char*)"analyse",temps_analyse); |
1288 |
|
|
change_temps_analyse(get_temps_analyse()+temps_analyse); |
1289 |
couturad |
919 |
} |
1290 |
|
|
|
1291 |
couturad |
968 |
int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement, |
1292 |
|
|
MSTRUCT_VES_FILE* ves_sph, |
1293 |
|
|
MSTRUCT_VES_FILE* ves_dev) |
1294 |
couturad |
933 |
{ |
1295 |
couturad |
968 |
OT_CPU ot_cpu; |
1296 |
|
|
ot_cpu.initialise(); |
1297 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
1298 |
|
|
char ligne[1000]; |
1299 |
|
|
for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++) |
1300 |
|
|
{ |
1301 |
|
|
OT_PARAMETRES* param = *it; |
1302 |
|
|
int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement"); |
1303 |
|
|
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
1304 |
|
|
if(get_analyse(Identifiant)!=NULL) |
1305 |
|
|
{ |
1306 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl; |
1307 |
|
|
return FAIL; |
1308 |
|
|
} |
1309 |
|
|
sprintf(ligne,"-> %s",Identifiant.c_str()); |
1310 |
|
|
affiche(ligne); |
1311 |
|
|
if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_MODULES_ELASTICITE) |
1312 |
|
|
{ |
1313 |
|
|
std::string Identifiant_epsilon = param->get_nom((char*)"Identifiant_epsilon"); |
1314 |
|
|
std::string Identifiant_sigma = param->get_nom((char*)"Identifiant_sigma"); |
1315 |
|
|
if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::CHAMP) |
1316 |
|
|
{ |
1317 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_epsilon); |
1318 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_sph = (MSTRUCT_ANALYSE_CHAMP*)ves_sph->get_analyse(Identifiant_sigma); |
1319 |
|
|
MSTRUCT_ANALYSE_CHAMP* epsilon_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_epsilon); |
1320 |
|
|
MSTRUCT_ANALYSE_CHAMP* sigma_dev = (MSTRUCT_ANALYSE_CHAMP*)ves_dev->get_analyse(Identifiant_sigma); |
1321 |
|
|
MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant,epsilon_sph,sigma_sph,epsilon_dev,sigma_dev); |
1322 |
|
|
analyse_modules_elasticite->executer(); |
1323 |
|
|
ajouter_analyse(analyse_modules_elasticite); |
1324 |
|
|
} |
1325 |
|
|
else if(ves_sph->get_analyse(Identifiant_epsilon)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1326 |
|
|
{ |
1327 |
|
|
MSTRUCT_ANALYSE_EROSION* epsilon_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_epsilon); |
1328 |
|
|
MSTRUCT_ANALYSE_EROSION* sigma_sph_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_sph->get_analyse(Identifiant_sigma); |
1329 |
|
|
MSTRUCT_ANALYSE_EROSION* epsilon_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_epsilon); |
1330 |
|
|
MSTRUCT_ANALYSE_EROSION* sigma_dev_erosion = (MSTRUCT_ANALYSE_EROSION*)ves_dev->get_analyse(Identifiant_sigma); |
1331 |
|
|
long Nb_couche = epsilon_sph_erosion->get_nb_analyse(); |
1332 |
|
|
double Epaisseur_couche = epsilon_sph_erosion->get_epaisseur_couche(); |
1333 |
|
|
std::string Nom_groupe_forme = epsilon_sph_erosion->get_nom_groupe_forme(); |
1334 |
|
|
BOITE_3D *boite_3d_analyse=epsilon_sph_erosion->get_boite_analyse(); |
1335 |
|
|
MSTRUCT_ANALYSE_EROSION* analyse_modules_elasticite_erosion = new MSTRUCT_ANALYSE_EROSION(Identifiant,Epaisseur_couche,Nom_groupe_forme,boite_3d_analyse); |
1336 |
|
|
for(int i=0;i<Nb_couche;i++) |
1337 |
|
|
{ |
1338 |
|
|
MSTRUCT_ANALYSE_MODULES_ELASTICITE* analyse_modules_elasticite = new MSTRUCT_ANALYSE_MODULES_ELASTICITE(Identifiant, |
1339 |
|
|
(MSTRUCT_ANALYSE_CHAMP*)epsilon_sph_erosion->get_analyse(i), |
1340 |
|
|
(MSTRUCT_ANALYSE_CHAMP*)sigma_sph_erosion->get_analyse(i), |
1341 |
|
|
(MSTRUCT_ANALYSE_CHAMP*)epsilon_dev_erosion->get_analyse(i), |
1342 |
|
|
(MSTRUCT_ANALYSE_CHAMP*)sigma_dev_erosion->get_analyse(i)); |
1343 |
|
|
analyse_modules_elasticite->executer(); |
1344 |
|
|
analyse_modules_elasticite_erosion->ajouter_analyse(analyse_modules_elasticite); |
1345 |
|
|
} |
1346 |
|
|
ajouter_analyse(analyse_modules_elasticite_erosion); |
1347 |
|
|
} |
1348 |
|
|
} |
1349 |
|
|
else |
1350 |
|
|
{ |
1351 |
|
|
sprintf(ligne,"ERREUR -> %s",Identifiant.c_str()); |
1352 |
|
|
affiche(ligne); |
1353 |
|
|
} |
1354 |
|
|
} |
1355 |
|
|
ot_cpu.ajouter_etape((char*)"analyse"); |
1356 |
|
|
double temps_analyse; |
1357 |
|
|
ot_cpu.get_etape((char*)"analyse",temps_analyse); |
1358 |
|
|
change_temps_analyse(get_temps_analyse()+temps_analyse); |
1359 |
|
|
} |
1360 |
|
|
|
1361 |
couturad |
971 |
int MSTRUCT_VES::generer_post_traitement(std::vector<OT_PARAMETRES *>& vector_params_post_traitement, |
1362 |
|
|
MSTRUCT_VES_FILE* ves_lambda_x, |
1363 |
|
|
MSTRUCT_VES_FILE* ves_lambda_y, |
1364 |
|
|
MSTRUCT_VES_FILE* ves_lambda_z) |
1365 |
|
|
{ |
1366 |
|
|
OT_CPU ot_cpu; |
1367 |
|
|
ot_cpu.initialise(); |
1368 |
|
|
std::vector<OT_PARAMETRES*>::iterator it; |
1369 |
|
|
char ligne[1000]; |
1370 |
|
|
for(it=vector_params_post_traitement.begin();it!=vector_params_post_traitement.end();it++) |
1371 |
|
|
{ |
1372 |
|
|
OT_PARAMETRES* param = *it; |
1373 |
|
|
int Type_post_traitement = (int)param->get_valeur((char*)"Type_post_traitement"); |
1374 |
|
|
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
1375 |
|
|
if(get_analyse(Identifiant)!=NULL) |
1376 |
|
|
{ |
1377 |
|
|
std::cerr << "*** Analyse [" << Identifiant << "] existante ***" << std::endl; |
1378 |
|
|
return FAIL; |
1379 |
|
|
} |
1380 |
|
|
sprintf(ligne,"-> %s",Identifiant.c_str()); |
1381 |
|
|
affiche(ligne); |
1382 |
|
|
if(Type_post_traitement==MSTRUCT::TYPE_POST_TRAITEMENT::POST_CONDUCTIVITE_THERMIQUE) |
1383 |
|
|
{ |
1384 |
|
|
std::string Identifiant = param->get_nom((char*)"Identifiant"); |
1385 |
|
|
if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION && |
1386 |
|
|
ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION && |
1387 |
|
|
ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::EROSION) |
1388 |
|
|
{ |
1389 |
|
|
MSTRUCT_ANALYSE_EROSION* erosion_lambda_x = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_x->get_analyse(Identifiant); |
1390 |
|
|
MSTRUCT_ANALYSE_EROSION* erosion_lambda_y = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_y->get_analyse(Identifiant); |
1391 |
|
|
MSTRUCT_ANALYSE_EROSION* erosion_lambda_z = (MSTRUCT_ANALYSE_EROSION*)ves_lambda_z->get_analyse(Identifiant); |
1392 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_x; |
1393 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_y; |
1394 |
|
|
std::vector<MSTRUCT_ANALYSE*>::iterator it_analyse_z; |
1395 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_premiere_analyse(it_analyse_x); |
1396 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_premiere_analyse(it_analyse_y); |
1397 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_premiere_analyse(it_analyse_z); |
1398 |
|
|
MSTRUCT_ANALYSE_EROSION* erosion_lambda_app = new MSTRUCT_ANALYSE_EROSION(Identifiant, |
1399 |
|
|
erosion_lambda_x->get_epaisseur_couche(), |
1400 |
|
|
erosion_lambda_x->get_nom_groupe_forme(), |
1401 |
|
|
erosion_lambda_x->get_boite_analyse()); |
1402 |
|
|
while(analyse_lambda_x!=NULL && analyse_lambda_y!=NULL && analyse_lambda_z!=NULL) |
1403 |
|
|
{ |
1404 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z); |
1405 |
|
|
analyse_lambda_app->executer(); |
1406 |
|
|
erosion_lambda_app->ajouter_analyse(analyse_lambda_app); |
1407 |
|
|
analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_x->get_suivante_analyse(it_analyse_x); |
1408 |
|
|
analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_y->get_suivante_analyse(it_analyse_y); |
1409 |
|
|
analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)erosion_lambda_z->get_suivante_analyse(it_analyse_z); |
1410 |
|
|
} |
1411 |
|
|
ajouter_analyse(erosion_lambda_app); |
1412 |
|
|
} |
1413 |
|
|
if(ves_lambda_x->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE && |
1414 |
|
|
ves_lambda_y->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE && |
1415 |
|
|
ves_lambda_z->get_analyse(Identifiant)->get_type()==MSTRUCT::TYPE_ANALYSE::CONDUCTIVITE_THERMIQUE) |
1416 |
|
|
{ |
1417 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_x=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_x->get_analyse(Identifiant); |
1418 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_y=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_y->get_analyse(Identifiant); |
1419 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_z=(MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE*)ves_lambda_z->get_analyse(Identifiant); |
1420 |
|
|
MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE* analyse_lambda_app = new MSTRUCT_ANALYSE_CONDUCTIVITE_THERMIQUE(Identifiant,analyse_lambda_x,analyse_lambda_y,analyse_lambda_z); |
1421 |
|
|
analyse_lambda_app->executer(); |
1422 |
|
|
ajouter_analyse(analyse_lambda_app); |
1423 |
|
|
} |
1424 |
|
|
} |
1425 |
|
|
else |
1426 |
|
|
{ |
1427 |
|
|
sprintf(ligne,"ERREUR -> %s",Identifiant.c_str()); |
1428 |
|
|
affiche(ligne); |
1429 |
|
|
} |
1430 |
|
|
} |
1431 |
|
|
ot_cpu.ajouter_etape((char*)"analyse"); |
1432 |
|
|
double temps_analyse; |
1433 |
|
|
ot_cpu.get_etape((char*)"analyse",temps_analyse); |
1434 |
|
|
change_temps_analyse(get_temps_analyse()+temps_analyse); |
1435 |
|
|
} |
1436 |
couturad |
968 |
|
1437 |
|
|
|
1438 |
couturad |
971 |
|
1439 |
|
|
|
1440 |
couturad |
968 |
int MSTRUCT_VES::exporter_maillage_abaqus(char* dossier) |
1441 |
|
|
{ |
1442 |
couturad |
933 |
std::ofstream f; |
1443 |
couturad |
968 |
char file[1000]; |
1444 |
|
|
sprintf(file,"%s/noeuds",dossier); |
1445 |
|
|
f.open(file,std::ios::out); |
1446 |
couturad |
933 |
f.precision(16); |
1447 |
|
|
f.setf(std::ios::showpoint); |
1448 |
|
|
f << "*NODE"<< std::endl; |
1449 |
|
|
LISTE_FEM_NOEUD::iterator it; |
1450 |
|
|
long index=1; |
1451 |
|
|
for (FEM_NOEUD* noeud=m_fem_maillage->get_premier_noeud(it);noeud;noeud=m_fem_maillage->get_suivant_noeud(it)) |
1452 |
|
|
{ |
1453 |
|
|
noeud->change_numero(index); |
1454 |
|
|
double *coord=noeud->get_coord(); |
1455 |
|
|
f << noeud->get_numero() << ", " << coord[0] << ", " << coord[1] << ", " << coord[2] << std::endl; |
1456 |
|
|
index++; |
1457 |
|
|
} |
1458 |
|
|
f.close(); |
1459 |
couturad |
968 |
sprintf(file,"%s/elements",dossier); |
1460 |
|
|
f.open(file,std::ios::out); |
1461 |
couturad |
933 |
f.precision(16); |
1462 |
|
|
f.setf(std::ios::showpoint); |
1463 |
|
|
index=1; |
1464 |
|
|
LISTE_FEM_ELEMENT3::iterator ittele3; |
1465 |
|
|
bool tetralin=false; |
1466 |
|
|
for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3)) |
1467 |
|
|
{ |
1468 |
|
|
if(ele3->get_type_entite()==IDFEM_TETRA4) |
1469 |
|
|
{ |
1470 |
|
|
if(tetralin==false) |
1471 |
|
|
{ |
1472 |
|
|
tetralin=true; |
1473 |
|
|
f << "*ELEMENT,TYPE=C3D4,ELSET=tetralin"<< std::endl; |
1474 |
|
|
} |
1475 |
|
|
f << index << ", " |
1476 |
|
|
<< ele3->get_fem_noeud(0)->get_numero() << ", " |
1477 |
|
|
<< ele3->get_fem_noeud(1)->get_numero() << ", " |
1478 |
|
|
<< ele3->get_fem_noeud(2)->get_numero() << ", " |
1479 |
|
|
<< ele3->get_fem_noeud(3)->get_numero() << std::endl; |
1480 |
|
|
ele3->change_numero(index); |
1481 |
|
|
index++; |
1482 |
|
|
} |
1483 |
|
|
} |
1484 |
|
|
bool pentalin=false; |
1485 |
|
|
for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3)) |
1486 |
|
|
{ |
1487 |
|
|
if(ele3->get_type_entite()==IDFEM_PENTA6) |
1488 |
|
|
{ |
1489 |
|
|
if(pentalin==false) |
1490 |
|
|
{ |
1491 |
|
|
pentalin=true; |
1492 |
|
|
f << "*ELEMENT,TYPE=C3D6,ELSET=pentalin"<< std::endl; |
1493 |
|
|
} |
1494 |
|
|
f << index << ", " |
1495 |
|
|
<< ele3->get_fem_noeud(0)->get_numero() << ", " |
1496 |
|
|
<< ele3->get_fem_noeud(1)->get_numero() << ", " |
1497 |
|
|
<< ele3->get_fem_noeud(2)->get_numero() << ", " |
1498 |
|
|
<< ele3->get_fem_noeud(3)->get_numero() << ", " |
1499 |
|
|
<< ele3->get_fem_noeud(4)->get_numero() << ", " |
1500 |
|
|
<< ele3->get_fem_noeud(5)->get_numero() << std::endl; |
1501 |
|
|
ele3->change_numero(index); |
1502 |
|
|
index++; |
1503 |
|
|
} |
1504 |
|
|
} |
1505 |
|
|
bool tetraquad=false; |
1506 |
|
|
for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3)) |
1507 |
|
|
{ |
1508 |
|
|
if(ele3->get_type_entite()==IDFEM_TETRA10) |
1509 |
|
|
{ |
1510 |
|
|
if(tetraquad==false) |
1511 |
|
|
{ |
1512 |
|
|
tetraquad=true; |
1513 |
|
|
f << "*ELEMENT,TYPE=C3D10,ELSET=tetraquad"<< std::endl; |
1514 |
|
|
} |
1515 |
|
|
f << index << ", " |
1516 |
|
|
<< ele3->get_fem_noeud(0)->get_numero() << ", " |
1517 |
|
|
<< ele3->get_fem_noeud(2)->get_numero() << ", " |
1518 |
|
|
<< ele3->get_fem_noeud(4)->get_numero() << ", " |
1519 |
|
|
<< ele3->get_fem_noeud(9)->get_numero() << ", " |
1520 |
|
|
<< ele3->get_fem_noeud(1)->get_numero() << ", " |
1521 |
|
|
<< ele3->get_fem_noeud(3)->get_numero() << ", " |
1522 |
|
|
<< ele3->get_fem_noeud(5)->get_numero() << ", " |
1523 |
|
|
<< ele3->get_fem_noeud(6)->get_numero() << ", " |
1524 |
|
|
<< ele3->get_fem_noeud(7)->get_numero() << ", " |
1525 |
|
|
<< ele3->get_fem_noeud(8)->get_numero() << std::endl; |
1526 |
|
|
ele3->change_numero(index); |
1527 |
|
|
index++; |
1528 |
|
|
} |
1529 |
|
|
} |
1530 |
|
|
bool pentaquad=false; |
1531 |
|
|
f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl; |
1532 |
|
|
for (FEM_ELEMENT3* ele3=m_fem_maillage->get_premier_element3(ittele3);ele3;ele3=m_fem_maillage->get_suivant_element3(ittele3)) |
1533 |
|
|
{ |
1534 |
|
|
if(ele3->get_type_entite()==IDFEM_PENTA15) |
1535 |
|
|
{ |
1536 |
|
|
if(pentaquad==false) |
1537 |
|
|
{ |
1538 |
|
|
pentaquad=true; |
1539 |
|
|
f << "*ELEMENT,TYPE=C3D15,ELSET=pentaquad"<< std::endl; |
1540 |
|
|
} |
1541 |
|
|
f << index << ", " |
1542 |
|
|
<< ele3->get_fem_noeud(0)->get_numero() << ", " |
1543 |
|
|
<< ele3->get_fem_noeud(2)->get_numero() << ", " |
1544 |
|
|
<< ele3->get_fem_noeud(4)->get_numero() << ", " |
1545 |
|
|
<< ele3->get_fem_noeud(9)->get_numero() << ", " |
1546 |
|
|
<< ele3->get_fem_noeud(11)->get_numero() << ", " |
1547 |
|
|
<< ele3->get_fem_noeud(13)->get_numero() << ", " |
1548 |
|
|
<< ele3->get_fem_noeud(1)->get_numero() << ", " |
1549 |
|
|
<< ele3->get_fem_noeud(3)->get_numero() << ", " |
1550 |
|
|
<< ele3->get_fem_noeud(5)->get_numero() << ", " |
1551 |
|
|
<< ele3->get_fem_noeud(10)->get_numero() << ", " |
1552 |
|
|
<< ele3->get_fem_noeud(12)->get_numero() << ", " |
1553 |
|
|
<< ele3->get_fem_noeud(14)->get_numero() << ", " |
1554 |
|
|
<< ele3->get_fem_noeud(6)->get_numero() << ", " |
1555 |
|
|
<< ele3->get_fem_noeud(7)->get_numero() << ", " |
1556 |
|
|
<< ele3->get_fem_noeud(8)->get_numero() << std::endl; |
1557 |
|
|
ele3->change_numero(index); |
1558 |
|
|
index++; |
1559 |
|
|
} |
1560 |
|
|
} |
1561 |
|
|
f.close(); |
1562 |
couturad |
968 |
sprintf(file,"%s/BC_nsets",dossier); |
1563 |
|
|
f.open(file,std::ios::out); |
1564 |
couturad |
933 |
f.precision(16); |
1565 |
|
|
f.setf(std::ios::showpoint); |
1566 |
|
|
BOITE_3D boite3D_ves = get_boite3d_ves(); |
1567 |
|
|
double eps = get_precision(); |
1568 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0; |
1569 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1; |
1570 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0; |
1571 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1; |
1572 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0; |
1573 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1; |
1574 |
|
|
std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face; |
1575 |
|
|
for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face)) |
1576 |
|
|
{ |
1577 |
|
|
double xyzmin[3]; |
1578 |
|
|
double xyzmax[3]; |
1579 |
|
|
face->get_xyz_min_max(xyzmin,xyzmax,16); |
1580 |
|
|
|
1581 |
|
|
if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face); |
1582 |
|
|
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); |
1583 |
|
|
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); |
1584 |
|
|
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); |
1585 |
|
|
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); |
1586 |
|
|
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); |
1587 |
|
|
} |
1588 |
|
|
MG_SOMMET* sommet_x0y0z0=NULL; |
1589 |
|
|
MG_SOMMET* sommet_x1y0z0=NULL; |
1590 |
|
|
MG_SOMMET* sommet_x0y1z0=NULL; |
1591 |
|
|
MG_SOMMET* sommet_x1y1z0=NULL; |
1592 |
|
|
MG_SOMMET* sommet_x0y0z1=NULL; |
1593 |
|
|
MG_SOMMET* sommet_x1y0z1=NULL; |
1594 |
|
|
MG_SOMMET* sommet_x0y1z1=NULL; |
1595 |
|
|
MG_SOMMET* sommet_x1y1z1=NULL; |
1596 |
|
|
std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet; |
1597 |
|
|
for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet)) |
1598 |
|
|
{ |
1599 |
|
|
double xyz[3]; |
1600 |
|
|
som->get_point()->evaluer(xyz); |
1601 |
|
|
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; |
1602 |
|
|
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; |
1603 |
|
|
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; |
1604 |
|
|
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; |
1605 |
|
|
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; |
1606 |
|
|
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; |
1607 |
|
|
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; |
1608 |
|
|
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; |
1609 |
|
|
} |
1610 |
|
|
f << "*NSET,NSET=coin_x0y0z0" << std::endl; |
1611 |
|
|
FEM_NOEUD* coin_x0y0z0 = (FEM_NOEUD*)(sommet_x0y0z0->get_lien_fem_maillage()->get(0)); |
1612 |
|
|
f << coin_x0y0z0->get_numero() << std::endl; |
1613 |
|
|
f << "*NSET,NSET=coin_x1y0z0" << std::endl; |
1614 |
|
|
FEM_NOEUD* coin_x1y0z0 = (FEM_NOEUD*)(sommet_x1y0z0->get_lien_fem_maillage()->get(0)); |
1615 |
|
|
f << coin_x1y0z0->get_numero() << std::endl; |
1616 |
|
|
f << "*NSET,NSET=coin_x0y1z0" << std::endl; |
1617 |
|
|
FEM_NOEUD* coin_x0y1z0 = (FEM_NOEUD*)(sommet_x0y1z0->get_lien_fem_maillage()->get(0)); |
1618 |
|
|
f << coin_x0y1z0->get_numero() << std::endl; |
1619 |
|
|
f << "*NSET,NSET=coin_x1y1z0" << std::endl; |
1620 |
|
|
FEM_NOEUD* coin_x1y1z0 = (FEM_NOEUD*)(sommet_x1y1z0->get_lien_fem_maillage()->get(0)); |
1621 |
|
|
f << coin_x1y1z0->get_numero() << std::endl; |
1622 |
|
|
f << "*NSET,NSET=coin_x0y0z1" << std::endl; |
1623 |
|
|
FEM_NOEUD* coin_x0y0z1 = (FEM_NOEUD*)(sommet_x0y0z1->get_lien_fem_maillage()->get(0)); |
1624 |
|
|
f << coin_x0y0z1->get_numero() << std::endl; |
1625 |
|
|
f << "*NSET,NSET=coin_x1y0z1" << std::endl; |
1626 |
|
|
FEM_NOEUD* coin_x1y0z1 = (FEM_NOEUD*)(sommet_x1y0z1->get_lien_fem_maillage()->get(0)); |
1627 |
|
|
f << coin_x1y0z1->get_numero() << std::endl; |
1628 |
|
|
f << "*NSET,NSET=coin_x0y1z1" << std::endl; |
1629 |
|
|
FEM_NOEUD* coin_x0y1z1 = (FEM_NOEUD*)(sommet_x0y1z1->get_lien_fem_maillage()->get(0)); |
1630 |
|
|
f << coin_x0y1z1->get_numero() << std::endl; |
1631 |
|
|
f << "*NSET,NSET=coin_x1y1z1" << std::endl; |
1632 |
|
|
FEM_NOEUD* coin_x1y1z1 = (FEM_NOEUD*)(sommet_x1y1z1->get_lien_fem_maillage()->get(0)); |
1633 |
|
|
f << coin_x1y1z1->get_numero() << std::endl; |
1634 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan; |
1635 |
|
|
f << "*NSET,NSET=xEQ0" << std::endl; |
1636 |
|
|
for(MG_FACE* face=plan_yz_x0.get_premier(it_face_plan);face!=NULL;face=plan_yz_x0.get_suivant(it_face_plan)) |
1637 |
|
|
{ |
1638 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1639 |
|
|
long nb_ele=lst_ele->get_nb(); |
1640 |
|
|
for(long i=0;i<nb_ele;i++) |
1641 |
|
|
{ |
1642 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1643 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1644 |
|
|
{ |
1645 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1646 |
|
|
} |
1647 |
|
|
} |
1648 |
|
|
} |
1649 |
|
|
f << "*NSET,NSET=xEQ1" << std::endl; |
1650 |
|
|
for(MG_FACE* face=plan_yz_x1.get_premier(it_face_plan);face!=NULL;face=plan_yz_x1.get_suivant(it_face_plan)) |
1651 |
|
|
{ |
1652 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1653 |
|
|
long nb_ele=lst_ele->get_nb(); |
1654 |
|
|
for(long i=0;i<nb_ele;i++) |
1655 |
|
|
{ |
1656 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1657 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1658 |
|
|
{ |
1659 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1660 |
|
|
} |
1661 |
|
|
} |
1662 |
|
|
} |
1663 |
|
|
f << "*NSET,NSET=yEQ0" << std::endl; |
1664 |
|
|
for(MG_FACE* face=plan_xz_y0.get_premier(it_face_plan);face!=NULL;face=plan_xz_y0.get_suivant(it_face_plan)) |
1665 |
|
|
{ |
1666 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1667 |
|
|
long nb_ele=lst_ele->get_nb(); |
1668 |
|
|
for(long i=0;i<nb_ele;i++) |
1669 |
|
|
{ |
1670 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1671 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1672 |
|
|
{ |
1673 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1674 |
|
|
} |
1675 |
|
|
} |
1676 |
|
|
} |
1677 |
|
|
f << "*NSET,NSET=yEQ1" << std::endl; |
1678 |
|
|
for(MG_FACE* face=plan_xz_y1.get_premier(it_face_plan);face!=NULL;face=plan_xz_y1.get_suivant(it_face_plan)) |
1679 |
|
|
{ |
1680 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1681 |
|
|
long nb_ele=lst_ele->get_nb(); |
1682 |
|
|
for(long i=0;i<nb_ele;i++) |
1683 |
|
|
{ |
1684 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1685 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1686 |
|
|
{ |
1687 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1688 |
|
|
} |
1689 |
|
|
} |
1690 |
|
|
} |
1691 |
|
|
f << "*NSET,NSET=zEQ0" << std::endl; |
1692 |
|
|
for(MG_FACE* face=plan_xy_z0.get_premier(it_face_plan);face!=NULL;face=plan_xy_z0.get_suivant(it_face_plan)) |
1693 |
|
|
{ |
1694 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1695 |
|
|
long nb_ele=lst_ele->get_nb(); |
1696 |
|
|
for(long i=0;i<nb_ele;i++) |
1697 |
|
|
{ |
1698 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1699 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1700 |
|
|
{ |
1701 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1702 |
|
|
} |
1703 |
|
|
} |
1704 |
|
|
} |
1705 |
|
|
f << "*NSET,NSET=zEQ1" << std::endl; |
1706 |
|
|
for(MG_FACE* face=plan_xy_z1.get_premier(it_face_plan);face!=NULL;face=plan_xy_z1.get_suivant(it_face_plan)) |
1707 |
|
|
{ |
1708 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=face->get_lien_fem_maillage(); |
1709 |
|
|
long nb_ele=lst_ele->get_nb(); |
1710 |
|
|
for(long i=0;i<nb_ele;i++) |
1711 |
|
|
{ |
1712 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)lst_ele->get(i); |
1713 |
|
|
for(int j=0;j<ele2->get_nb_fem_noeud();j++) |
1714 |
|
|
{ |
1715 |
|
|
f << ele2->get_fem_noeud(j)->get_numero() << std::endl; |
1716 |
|
|
} |
1717 |
|
|
} |
1718 |
|
|
} |
1719 |
|
|
f.close(); |
1720 |
couturad |
968 |
sprintf(file,"%s/groupes_elements",dossier); |
1721 |
|
|
f.open(file,std::ios::out); |
1722 |
couturad |
933 |
f.precision(16); |
1723 |
|
|
f.setf(std::ios::showpoint); |
1724 |
|
|
std::map<long,MG_CG_GROUPE_FORME*>::iterator it_groupe_forme; |
1725 |
|
|
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)) |
1726 |
|
|
{ |
1727 |
|
|
f << "*ELSET,ELSET=" << groupe_forme->get_nom() << std::endl; |
1728 |
|
|
TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume = groupe_forme->get_tpl_map_volume(); |
1729 |
|
|
TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_volume; |
1730 |
|
|
for(MG_VOLUME* volume=tpl_map_volume.get_premier(it_volume);volume!=NULL;volume=tpl_map_volume.get_suivant(it_volume)) |
1731 |
|
|
{ |
1732 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage(); |
1733 |
|
|
long nb_ele=lst_ele->get_nb(); |
1734 |
|
|
for(long i=0;i<nb_ele;i++) |
1735 |
|
|
{ |
1736 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i); |
1737 |
|
|
f << ele3->get_numero() << std::endl; |
1738 |
|
|
} |
1739 |
|
|
} |
1740 |
|
|
} |
1741 |
couturad |
937 |
|
1742 |
couturad |
968 |
MG_CG_GROUPE_FORME* groupe_forme_particule=m_mgcg_modele->get_mgcg_groupe_forme((char*)"Particule"); |
1743 |
couturad |
937 |
if(groupe_forme_particule!=NULL) |
1744 |
|
|
{ |
1745 |
couturad |
968 |
sprintf(file,"%s/particules",dossier); |
1746 |
|
|
f.open(file,std::ios::out); |
1747 |
couturad |
937 |
f.precision(16); |
1748 |
|
|
f.setf(std::ios::showpoint); |
1749 |
|
|
std::ofstream f2; |
1750 |
|
|
f2.open((char*)"infos_particules"); |
1751 |
|
|
f2.precision(16); |
1752 |
|
|
f2.setf(std::ios::showpoint); |
1753 |
|
|
f2 << "# centre_x centre_y centre_z rayon position_relative" << std::endl; |
1754 |
|
|
std::ofstream f_bord; |
1755 |
|
|
f_bord.open((char*)"particules_bord"); |
1756 |
|
|
f_bord.precision(16); |
1757 |
|
|
f_bord.setf(std::ios::showpoint); |
1758 |
|
|
std::ofstream f_interieur; |
1759 |
|
|
f_interieur.open((char*)"particules_interieur"); |
1760 |
|
|
f_interieur.precision(16); |
1761 |
|
|
f_interieur.setf(std::ios::showpoint); |
1762 |
|
|
long p=1; |
1763 |
|
|
std::map<long,MG_CG_FORME*>::iterator it_forme; |
1764 |
|
|
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)) |
1765 |
|
|
{ |
1766 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
1767 |
|
|
{ |
1768 |
|
|
f << "*ELSET,ELSET=P_" << p << std::endl; |
1769 |
|
|
MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE"); |
1770 |
|
|
MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON"); |
1771 |
|
|
MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE"); |
1772 |
|
|
std::vector<double> vct_centre = centre->get_vct_valeur(); |
1773 |
|
|
f2 << p << " " |
1774 |
|
|
<< vct_centre.at(0) << " " |
1775 |
|
|
<< vct_centre.at(1) << " " |
1776 |
|
|
<< vct_centre.at(2) << " " |
1777 |
|
|
<< rayon->get_valeur() << " " |
1778 |
|
|
<< pos_rel->get_valeur() << std::endl; |
1779 |
|
|
bool au_bord; |
1780 |
|
|
if(pos_rel->get_valeur()=="AU_BORD") au_bord=true; |
1781 |
|
|
else au_bord=false; |
1782 |
|
|
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
1783 |
|
|
MG_VOLUME* volume = forme_volume->get_mg_volume(); |
1784 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage(); |
1785 |
|
|
long nb_ele=lst_ele->get_nb(); |
1786 |
|
|
if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl; |
1787 |
|
|
else f_interieur << "*ELSET,ELSET=P_" << p << std::endl; |
1788 |
|
|
for(long i=0;i<nb_ele;i++) |
1789 |
|
|
{ |
1790 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i); |
1791 |
|
|
f << ele3->get_numero() << std::endl; |
1792 |
|
|
if(au_bord)f_bord << ele3->get_numero() << std::endl; |
1793 |
|
|
else f_interieur << ele3->get_numero() << std::endl; |
1794 |
|
|
} |
1795 |
|
|
p++; |
1796 |
|
|
} |
1797 |
|
|
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
1798 |
|
|
{ |
1799 |
|
|
f << "*ELSET,ELSET=P_" << p << std::endl; |
1800 |
|
|
MG_CG_INFO_VCT_DOUBLE* centre = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info((char*)"CENTRE"); |
1801 |
|
|
MG_CG_INFO_DOUBLE* rayon = (MG_CG_INFO_DOUBLE*)forme->get_mgcg_info((char*)"RAYON"); |
1802 |
|
|
MG_CG_INFO_STRING* pos_rel = (MG_CG_INFO_STRING*)forme->get_mgcg_info((char*)"POSITION_RELATIVE"); |
1803 |
|
|
std::vector<double> vct_centre = centre->get_vct_valeur(); |
1804 |
|
|
f2 << p << " " |
1805 |
|
|
<< vct_centre.at(0) << " " |
1806 |
|
|
<< vct_centre.at(1) << " " |
1807 |
|
|
<< vct_centre.at(2) << " " |
1808 |
|
|
<< rayon->get_valeur() << " " |
1809 |
|
|
<< pos_rel->get_valeur() << std::endl; |
1810 |
|
|
bool au_bord; |
1811 |
|
|
if(pos_rel->get_valeur()=="AU_BORD") au_bord=true; |
1812 |
|
|
else au_bord=false; |
1813 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
1814 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
1815 |
|
|
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)) |
1816 |
|
|
{ |
1817 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *lst_ele=volume->get_lien_fem_maillage(); |
1818 |
|
|
long nb_ele=lst_ele->get_nb(); |
1819 |
|
|
if(au_bord) f_bord << "*ELSET,ELSET=P_" << p << std::endl; |
1820 |
|
|
else f_interieur << "*ELSET,ELSET=P_" << p << std::endl; |
1821 |
|
|
for(long i=0;i<nb_ele;i++) |
1822 |
|
|
{ |
1823 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)lst_ele->get(i); |
1824 |
|
|
f << ele3->get_numero() << std::endl; |
1825 |
|
|
if(au_bord)f_bord << ele3->get_numero() << std::endl; |
1826 |
|
|
else f_interieur << ele3->get_numero() << std::endl; |
1827 |
|
|
} |
1828 |
|
|
} |
1829 |
|
|
p++; |
1830 |
|
|
} |
1831 |
|
|
} |
1832 |
|
|
f_bord.close(); |
1833 |
|
|
f_interieur.close(); |
1834 |
|
|
f2.close(); |
1835 |
|
|
f.close(); |
1836 |
|
|
} |
1837 |
couturad |
933 |
} |
1838 |
couturad |
926 |
|
1839 |
couturad |
933 |
|
1840 |
couturad |
926 |
int MSTRUCT_VES::enregistrer(char* fichier_ves) |
1841 |
couturad |
919 |
{ |
1842 |
couturad |
926 |
m_ves_file->enregistrer(fichier_ves); |
1843 |
couturad |
919 |
} |
1844 |
|
|
|
1845 |
couturad |
926 |
int MSTRUCT_VES::enregistrer(char *fichier_ves,char* fichier_magic) |
1846 |
couturad |
919 |
{ |
1847 |
couturad |
926 |
m_ves_file->change_nom_fichier_magic(fichier_magic); |
1848 |
|
|
m_ves_file->enregistrer(fichier_ves); |
1849 |
|
|
m_mg_gestionnaire->enregistrer(fichier_magic); |
1850 |
couturad |
919 |
} |
1851 |
|
|
|
1852 |
couturad |
951 |
void MSTRUCT_VES::active_affichage(fonction_affiche* fonc) |
1853 |
couturad |
919 |
{ |
1854 |
|
|
fonc_affiche = fonc; |
1855 |
|
|
affichageactif = 1; |
1856 |
|
|
} |
1857 |
|
|
|
1858 |
couturad |
926 |
void MSTRUCT_VES::affiche(char* message) |
1859 |
couturad |
919 |
{ |
1860 |
|
|
if(affichageactif==1) fonc_affiche(message); |
1861 |
|
|
} |
1862 |
|
|
|
1863 |
|
|
|
1864 |
|
|
|
1865 |
|
|
|
1866 |
|
|
|