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