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