1 |
couturad |
919 |
#include "mstruct_outils.h" |
2 |
couturad |
926 |
#include "mg_cg_groupe_forme.h" |
3 |
couturad |
919 |
#include "ot_geometrie.h" |
4 |
couturad |
982 |
#include "mg_geometrie.h" |
5 |
couturad |
919 |
#include "mg_maillage.h" |
6 |
|
|
#include "fem_maillage.h" |
7 |
|
|
#include "mg_cg_forme.h" |
8 |
|
|
#include "mg_cg_forme_multi_volume.h" |
9 |
|
|
#include "mg_cg_forme_volume.h" |
10 |
couturad |
926 |
#include "ot_tenseur.h" |
11 |
|
|
#include "mg_cg_info.h" |
12 |
|
|
#include "fem_maillage_quadratique_outils.h" |
13 |
couturad |
919 |
#include <math.h> |
14 |
couturad |
982 |
#include "mstruct_definition.h" |
15 |
couturad |
919 |
|
16 |
|
|
|
17 |
couturad |
951 |
int MSTRUCT_OUTILS::statistiques_champ_volumique(FEM_SOLUTION* fem_sol, |
18 |
couturad |
926 |
MG_CG_GROUPE_FORME* groupe_forme, |
19 |
|
|
BOITE_3D* boite_analyse, |
20 |
|
|
double* moyenne, |
21 |
|
|
double* ecart_type, |
22 |
|
|
double* min, |
23 |
|
|
double* max, |
24 |
|
|
OT_HISTOGRAMME** tab_histogramme) |
25 |
couturad |
919 |
{ |
26 |
couturad |
926 |
int nb_champ = fem_sol->get_nb_champ(); |
27 |
|
|
double volume_total=0.0; |
28 |
|
|
for(int i=0;i<nb_champ;i++) |
29 |
couturad |
919 |
{ |
30 |
couturad |
926 |
moyenne[i]=0.0; |
31 |
|
|
ecart_type[i]=0.0; |
32 |
couturad |
951 |
min[i]=std::numeric_limits< double >::max(); |
33 |
|
|
max[i]=std::numeric_limits< double >::min(); |
34 |
couturad |
926 |
} |
35 |
|
|
std::vector<double*> vector_champ; |
36 |
|
|
std::vector<double> vector_volume; |
37 |
|
|
LISTE_FEM_ELEMENT3::iterator it; |
38 |
|
|
FEM_MAILLAGE* fem_mail = fem_sol->get_maillage(); |
39 |
couturad |
971 |
if(fem_sol->get_entite_solution()==MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD) fem_sol->active_solution(0); |
40 |
couturad |
926 |
long k=0; |
41 |
couturad |
943 |
for (FEM_ELEMENT3* ele=fem_mail->get_premier_element3(it);ele!=NULL;ele=fem_mail->get_suivant_element3(it)) |
42 |
couturad |
926 |
{ |
43 |
|
|
bool ok=false; |
44 |
|
|
if(groupe_forme!=NULL) |
45 |
couturad |
919 |
{ |
46 |
couturad |
926 |
TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume = groupe_forme->get_tpl_map_volume(); |
47 |
|
|
TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_volume; |
48 |
|
|
MG_VOLUME* mg_vol=tpl_map_volume.get_premier(it_volume); |
49 |
|
|
while(ok==false && mg_vol!=NULL) |
50 |
|
|
{ |
51 |
|
|
if(ele->get_lien_topologie()==mg_vol) ok=true; |
52 |
|
|
else mg_vol=tpl_map_volume.get_suivant(it_volume); |
53 |
|
|
} |
54 |
|
|
} else ok=true; |
55 |
|
|
if(boite_analyse!=NULL && ok==true) |
56 |
|
|
{ |
57 |
|
|
BOITE_3D b3d = ele->get_boite_3D(); |
58 |
|
|
if(!boite_analyse->contient(b3d.get_xcentre(),b3d.get_ycentre(),b3d.get_zcentre())) ok=false; |
59 |
couturad |
919 |
} |
60 |
couturad |
926 |
if(ok==true) |
61 |
|
|
{ |
62 |
|
|
double *champ=new double[nb_champ]; |
63 |
|
|
double volume; |
64 |
|
|
for(int i=0;i<nb_champ;i++) |
65 |
|
|
{ |
66 |
|
|
double unite=fem_mail->get_mg_geometrie()->get_valeur_unite(); |
67 |
|
|
double val=0.; |
68 |
|
|
volume=0; |
69 |
couturad |
968 |
if(fem_sol->get_entite_solution()==MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3_GAUSS) |
70 |
|
|
{ |
71 |
|
|
int nbgauss=fem_sol->get_nb_gauss(k); |
72 |
|
|
for (int r=0;r<nbgauss;r++) |
73 |
|
|
{ |
74 |
|
|
int degre=ele->get_degre_gauss(nbgauss); |
75 |
|
|
double w; |
76 |
|
|
double uvw[3]; |
77 |
|
|
ele->get_pt_gauss(degre,r,w,uvw); |
78 |
|
|
double jac[9]; |
79 |
|
|
int l,c; |
80 |
|
|
double det=ele->get_jacobien(jac,uvw,l,c,unite); |
81 |
|
|
double valeur=fem_sol->lire(k,i,0,r)*fabs(det); |
82 |
|
|
val=val+w*valeur; |
83 |
|
|
volume=volume+w*fabs(det); |
84 |
|
|
} |
85 |
|
|
} |
86 |
|
|
else if(fem_sol->get_entite_solution()==MAGIC::ENTITE_SOLUTION::ENTITE_ELEMENT3) |
87 |
|
|
{ |
88 |
|
|
int nb_pt_gauss=ele->get_nb_pt_gauss(ele->get_degremax_fonction_interpolation()); |
89 |
|
|
for (int r=0;r<nb_pt_gauss;r++) |
90 |
|
|
{ |
91 |
|
|
int degre=ele->get_degre_gauss(nb_pt_gauss); |
92 |
|
|
double w; |
93 |
|
|
double uvw[3]; |
94 |
|
|
ele->get_pt_gauss(degre,r,w,uvw); |
95 |
|
|
double jac[9]; |
96 |
|
|
int l,c; |
97 |
|
|
double det=ele->get_jacobien(jac,uvw,l,c); |
98 |
couturad |
971 |
volume+=w*fabs(det); |
99 |
couturad |
968 |
} |
100 |
|
|
val=fem_sol->lire(k,i,0,0)*volume; |
101 |
|
|
} |
102 |
couturad |
971 |
else if(fem_sol->get_entite_solution()==MAGIC::ENTITE_SOLUTION::ENTITE_NOEUD) |
103 |
|
|
{ |
104 |
|
|
double w; |
105 |
|
|
double uvw[3]; |
106 |
|
|
double jac[9]; |
107 |
|
|
int li,col; |
108 |
|
|
double degmax=ele->get_degremax_fonction_interpolation(); |
109 |
|
|
int nbfonc=ele->get_nb_fonction_interpolation(); |
110 |
|
|
int nb_pt_gauss=ele->get_nb_pt_gauss(degmax); |
111 |
|
|
for (int r=0;r<nb_pt_gauss;r++) |
112 |
|
|
{ |
113 |
|
|
ele->get_pt_gauss(degmax,r,w,uvw); |
114 |
|
|
double detJ=ele->get_jacobien(jac,uvw,li,col,unite); |
115 |
|
|
double C=0.0; |
116 |
|
|
for(int j=0;j<nbfonc;j++) |
117 |
|
|
{ |
118 |
|
|
C+=ele->get_fonction_interpolation(j+1,uvw)*ele->get_fem_noeud(j)->get_solution()*(pow(unite,3)); |
119 |
|
|
} |
120 |
|
|
C=C*w*fabs(detJ); |
121 |
|
|
val+=C; |
122 |
|
|
volume+=w*fabs(detJ); |
123 |
|
|
} |
124 |
|
|
} |
125 |
couturad |
926 |
champ[i] = val; |
126 |
|
|
} |
127 |
|
|
vector_champ.push_back(champ); |
128 |
|
|
vector_volume.push_back(volume); |
129 |
|
|
volume_total+=volume; |
130 |
|
|
} |
131 |
|
|
k++; |
132 |
couturad |
966 |
} |
133 |
couturad |
926 |
long nb_echantillions=vector_champ.size(); |
134 |
|
|
std::vector<double*>::iterator it_vector_champ; |
135 |
couturad |
966 |
std::vector<double>::iterator it_vector_volume=vector_volume.begin(); |
136 |
|
|
for(it_vector_champ=vector_champ.begin();it_vector_champ!=vector_champ.end();it_vector_champ++) |
137 |
couturad |
926 |
{ |
138 |
|
|
double *champ = *it_vector_champ; |
139 |
|
|
double volume = *it_vector_volume; |
140 |
couturad |
943 |
for(int i=0;i<nb_champ;i++) |
141 |
|
|
{ |
142 |
|
|
moyenne[i]+=champ[i]; |
143 |
couturad |
974 |
if((champ[i]/volume)<min[i]) min[i]=champ[i]/volume; |
144 |
|
|
if((champ[i]/volume)>max[i]) max[i]=champ[i]/volume; |
145 |
|
|
tab_histogramme[i]->ajouter_valeur(champ[i]/volume,volume/volume_total); |
146 |
couturad |
943 |
} |
147 |
couturad |
966 |
it_vector_volume++; |
148 |
couturad |
919 |
} |
149 |
couturad |
926 |
for(int i=0;i<nb_champ;i++) |
150 |
couturad |
919 |
{ |
151 |
couturad |
943 |
moyenne[i]=moyenne[i]/volume_total; |
152 |
couturad |
926 |
} |
153 |
|
|
for(it_vector_champ=vector_champ.begin(),it_vector_volume=vector_volume.begin();it_vector_champ!=vector_champ.end();it_vector_champ++,it_vector_volume++) |
154 |
|
|
{ |
155 |
|
|
double *champ = *it_vector_champ; |
156 |
couturad |
974 |
double volume = *it_vector_volume; |
157 |
couturad |
926 |
for(int i=0;i<nb_champ;i++) |
158 |
couturad |
919 |
{ |
159 |
couturad |
974 |
ecart_type[i]+=((champ[i]/volume)-moyenne[i])*((champ[i]/volume)-moyenne[i]); |
160 |
couturad |
919 |
} |
161 |
|
|
} |
162 |
couturad |
926 |
for(it_vector_champ=vector_champ.begin();it_vector_champ!=vector_champ.end();it_vector_champ++) delete [] *it_vector_champ; |
163 |
|
|
for(int i=0;i<nb_champ;i++) |
164 |
|
|
{ |
165 |
|
|
ecart_type[i]=ecart_type[i]*(1.0/(nb_echantillions-1.0)); |
166 |
|
|
ecart_type[i]=sqrt(ecart_type[i]); |
167 |
|
|
} |
168 |
|
|
return OK; |
169 |
couturad |
919 |
} |
170 |
|
|
|
171 |
couturad |
951 |
int MSTRUCT_OUTILS::statistiques_tenseur_orientation(MG_CG_GROUPE_FORME* groupe_forme, |
172 |
couturad |
926 |
BOITE_3D* boite_analyse, |
173 |
|
|
double* moyenne, |
174 |
|
|
double* ecart_type, |
175 |
|
|
double* min, |
176 |
couturad |
938 |
double* max, |
177 |
couturad |
951 |
FEM_MAILLAGE *fem, |
178 |
couturad |
938 |
bool ponderation_volume) |
179 |
couturad |
919 |
{ |
180 |
couturad |
938 |
double volume_total=0; |
181 |
couturad |
942 |
std::vector<double> vector_volume; |
182 |
couturad |
926 |
for(int i=0;i<6;i++) |
183 |
couturad |
919 |
{ |
184 |
couturad |
926 |
moyenne[i]=0.0; |
185 |
|
|
ecart_type[i]=0.0; |
186 |
couturad |
951 |
min[i]=std::numeric_limits< double >::max(); |
187 |
|
|
max[i]=std::numeric_limits< double >::min(); |
188 |
couturad |
919 |
} |
189 |
couturad |
926 |
std::vector<double*> vector_tenseur; |
190 |
|
|
std::map<long,MG_CG_FORME*>::iterator it_forme; |
191 |
|
|
for(MG_CG_FORME* forme=groupe_forme->get_premiere_mgcg_forme(it_forme);forme!=NULL;forme=groupe_forme->get_suivante_mgcg_forme(it_forme)) |
192 |
couturad |
919 |
{ |
193 |
couturad |
926 |
BOITE_3D boite_forme = forme->get_boite_3D(); |
194 |
|
|
bool ok=true; |
195 |
|
|
if(boite_analyse!=NULL) |
196 |
couturad |
919 |
{ |
197 |
couturad |
951 |
if(boite_analyse->get_intersection(boite_forme)) ok=true; |
198 |
couturad |
926 |
else ok=false; |
199 |
couturad |
919 |
} |
200 |
couturad |
926 |
if(ok) |
201 |
|
|
{ |
202 |
|
|
double axe_forme[3]; |
203 |
|
|
MG_CG_INFO_VCT_DOUBLE* info_axe = (MG_CG_INFO_VCT_DOUBLE*)forme->get_mgcg_info("AXE"); |
204 |
|
|
std::vector<double> vct_double = info_axe->get_vct_valeur(); |
205 |
|
|
axe_forme[0]=vct_double[0]; |
206 |
|
|
axe_forme[1]=vct_double[1]; |
207 |
|
|
axe_forme[2]=vct_double[2]; |
208 |
|
|
double *tenseur = new double[6]; |
209 |
|
|
tenseur[0] = axe_forme[0]*axe_forme[0]; |
210 |
|
|
tenseur[1] = axe_forme[1]*axe_forme[1]; |
211 |
|
|
tenseur[2] = axe_forme[2]*axe_forme[2]; |
212 |
|
|
tenseur[3] = axe_forme[0]*axe_forme[1]; |
213 |
|
|
tenseur[4] = axe_forme[0]*axe_forme[2]; |
214 |
|
|
tenseur[5] = axe_forme[1]*axe_forme[2]; |
215 |
couturad |
938 |
if(ponderation_volume) |
216 |
|
|
{ |
217 |
couturad |
951 |
if(fem==NULL) |
218 |
couturad |
938 |
{ |
219 |
couturad |
951 |
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
220 |
|
|
{ |
221 |
|
|
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
222 |
|
|
double volume=OT_GEOMETRIE::get_volume(forme_volume->get_mg_volume(),1.0e-06); |
223 |
|
|
vector_volume.push_back(volume); |
224 |
|
|
volume_total+=volume; |
225 |
|
|
} |
226 |
|
|
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
227 |
|
|
{ |
228 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
229 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
230 |
|
|
double volume=0; |
231 |
|
|
for(MG_VOLUME* vol=forme_multi_volume->get_premier_mg_volume(it_volume);vol!=NULL;vol=forme_multi_volume->get_suivant_mg_volume(it_volume)) |
232 |
|
|
{ |
233 |
|
|
volume+=OT_GEOMETRIE::get_volume(vol,1.0e-06); |
234 |
|
|
} |
235 |
|
|
vector_volume.push_back(volume); |
236 |
|
|
volume_total+=volume; |
237 |
|
|
} |
238 |
couturad |
938 |
} |
239 |
couturad |
951 |
else |
240 |
couturad |
938 |
{ |
241 |
couturad |
951 |
double volume=get_volume_mgcg_forme(forme,fem,boite_analyse); |
242 |
couturad |
942 |
vector_volume.push_back(volume); |
243 |
couturad |
938 |
volume_total+=volume; |
244 |
|
|
} |
245 |
|
|
} |
246 |
couturad |
926 |
vector_tenseur.push_back(tenseur); |
247 |
|
|
} |
248 |
couturad |
919 |
} |
249 |
couturad |
926 |
long nb_forme=vector_tenseur.size(); |
250 |
|
|
std::vector<double*>::iterator it_tenseur; |
251 |
couturad |
942 |
std::vector<double>::iterator it_volume=vector_volume.begin(); |
252 |
couturad |
926 |
for(it_tenseur=vector_tenseur.begin();it_tenseur!=vector_tenseur.end();it_tenseur++) |
253 |
couturad |
919 |
{ |
254 |
couturad |
926 |
double* tenseur = *it_tenseur; |
255 |
|
|
for(int i=0;i<6;i++) |
256 |
couturad |
919 |
{ |
257 |
couturad |
942 |
if(!ponderation_volume) |
258 |
|
|
{ |
259 |
|
|
moyenne[i]+=tenseur[i]; |
260 |
|
|
if(tenseur[i]<min[i]) min[i]=tenseur[i]; |
261 |
|
|
if(tenseur[i]>max[i]) max[i]=tenseur[i]; |
262 |
|
|
} |
263 |
|
|
else |
264 |
|
|
{ |
265 |
|
|
double volume=*it_volume; |
266 |
|
|
moyenne[i]+=tenseur[i]*volume/volume_total; |
267 |
|
|
if(tenseur[i]<min[i]) min[i]=tenseur[i]; |
268 |
|
|
if(tenseur[i]>max[i]) max[i]=tenseur[i]; |
269 |
|
|
} |
270 |
couturad |
919 |
} |
271 |
couturad |
951 |
it_volume++; |
272 |
couturad |
919 |
} |
273 |
couturad |
942 |
if(!ponderation_volume) |
274 |
couturad |
926 |
for(int i=0;i<6;i++) |
275 |
couturad |
919 |
{ |
276 |
couturad |
926 |
moyenne[i]=moyenne[i]/nb_forme; |
277 |
|
|
} |
278 |
|
|
for(it_tenseur=vector_tenseur.begin();it_tenseur!=vector_tenseur.end();it_tenseur++) |
279 |
|
|
{ |
280 |
|
|
double* tenseur = *it_tenseur; |
281 |
|
|
for(int i=0;i<6;i++) |
282 |
couturad |
919 |
{ |
283 |
couturad |
926 |
ecart_type[i]+=(tenseur[i]-moyenne[i])*(tenseur[i]-moyenne[i]); |
284 |
couturad |
919 |
} |
285 |
couturad |
926 |
delete [] *it_tenseur; |
286 |
couturad |
919 |
} |
287 |
couturad |
926 |
for(int i=0;i<6;i++) |
288 |
|
|
{ |
289 |
|
|
ecart_type[i]=ecart_type[i]*(1.0/(nb_forme-1.0)); |
290 |
|
|
ecart_type[i]=sqrt(ecart_type[i]); |
291 |
|
|
} |
292 |
|
|
return OK; |
293 |
couturad |
919 |
} |
294 |
|
|
|
295 |
couturad |
951 |
int MSTRUCT_OUTILS::statistiques_CAO(BOITE_3D boite_VES, |
296 |
|
|
TPL_MAP_ENTITE< MG_CG_FORME* >& tpl_map_forme, |
297 |
|
|
long int& nb_forme, |
298 |
|
|
long int& nb_volume, |
299 |
|
|
double& volume_forme_moyenne, |
300 |
|
|
double& volume_forme_ecart_type, |
301 |
|
|
double& volume_forme_min, |
302 |
|
|
double& volume_forme_max, |
303 |
|
|
OT_HISTOGRAMME& volume_forme_histogramme, |
304 |
|
|
double& volume_total, |
305 |
|
|
double& fraction_volumique, |
306 |
|
|
double precision) |
307 |
couturad |
919 |
{ |
308 |
couturad |
926 |
double volume_ves = boite_VES.get_volume(); |
309 |
|
|
nb_forme=0; |
310 |
|
|
nb_volume=0; |
311 |
|
|
volume_forme_moyenne=0; |
312 |
|
|
volume_forme_ecart_type=0; |
313 |
couturad |
951 |
volume_forme_min=std::numeric_limits< double >::max(); |
314 |
|
|
volume_forme_max=std::numeric_limits< double >::min(); |
315 |
couturad |
926 |
volume_total=0; |
316 |
|
|
std::vector<double> vector_volume; |
317 |
|
|
|
318 |
|
|
TPL_MAP_ENTITE<MG_CG_FORME*>::ITERATEUR it_forme; |
319 |
|
|
for(MG_CG_FORME* forme=tpl_map_forme.get_premier(it_forme);forme!=NULL;forme=tpl_map_forme.get_suivant(it_forme)) |
320 |
couturad |
919 |
{ |
321 |
couturad |
926 |
TPL_MAP_ENTITE<MG_VOLUME*> tpl_map_volume; |
322 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
323 |
couturad |
919 |
{ |
324 |
couturad |
926 |
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
325 |
|
|
tpl_map_volume.ajouter(forme_volume->get_mg_volume()); |
326 |
couturad |
919 |
} |
327 |
couturad |
926 |
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
328 |
|
|
{ |
329 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
330 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
331 |
|
|
for(MG_VOLUME* vol=forme_multi_volume->get_premier_mg_volume(it_volume);vol!=NULL;vol=forme_multi_volume->get_suivant_mg_volume(it_volume)) |
332 |
|
|
{ |
333 |
|
|
tpl_map_volume.ajouter(vol); |
334 |
|
|
} |
335 |
|
|
} |
336 |
|
|
double volume_forme=0; |
337 |
|
|
nb_volume += tpl_map_volume.get_nb(); |
338 |
|
|
TPL_MAP_ENTITE<MG_VOLUME*>::ITERATEUR it_mg_volume; |
339 |
|
|
for(MG_VOLUME* vol=tpl_map_volume.get_premier(it_mg_volume);vol!=NULL;vol=tpl_map_volume.get_suivant(it_mg_volume)) |
340 |
|
|
{ |
341 |
|
|
volume_forme += OT_GEOMETRIE::get_volume(vol,precision); |
342 |
|
|
} |
343 |
|
|
vector_volume.push_back(volume_forme); |
344 |
couturad |
919 |
} |
345 |
couturad |
926 |
std::vector<double>::iterator it_data; |
346 |
|
|
for(it_data=vector_volume.begin();it_data!=vector_volume.end();it_data++) |
347 |
couturad |
919 |
{ |
348 |
couturad |
926 |
double volume = *it_data; |
349 |
|
|
volume_total+=volume; |
350 |
|
|
if(volume<volume_forme_min) volume_forme_min=volume; |
351 |
|
|
if(volume>volume_forme_max) volume_forme_max=volume; |
352 |
couturad |
919 |
} |
353 |
couturad |
926 |
for(it_data=vector_volume.begin();it_data!=vector_volume.end();it_data++) |
354 |
|
|
{ |
355 |
|
|
double volume = *it_data; |
356 |
|
|
volume_forme_histogramme.ajouter_valeur(volume,volume/volume_total); |
357 |
|
|
} |
358 |
|
|
nb_forme=vector_volume.size(); |
359 |
|
|
volume_forme_moyenne=volume_total/nb_forme; |
360 |
|
|
if(nb_forme>1) |
361 |
|
|
{ |
362 |
|
|
for(it_data=vector_volume.begin();it_data!=vector_volume.end();it_data++) |
363 |
|
|
{ |
364 |
|
|
double volume = *it_data; |
365 |
|
|
volume_forme_ecart_type+=(volume-volume_forme_moyenne)*(volume-volume_forme_moyenne); |
366 |
|
|
} |
367 |
|
|
volume_forme_ecart_type=volume_forme_ecart_type*(1.0/(nb_forme-1.0)); |
368 |
|
|
volume_forme_ecart_type=sqrt(volume_forme_ecart_type); |
369 |
|
|
} |
370 |
couturad |
951 |
else volume_forme_ecart_type = 0.0; |
371 |
couturad |
926 |
fraction_volumique = volume_total/volume_ves; |
372 |
couturad |
919 |
} |
373 |
|
|
|
374 |
couturad |
951 |
int MSTRUCT_OUTILS::statistiques_mg_maillage(BOITE_3D boite_VES, |
375 |
|
|
MG_MAILLAGE* mai, |
376 |
|
|
TPL_MAP_ENTITE<MG_CG_FORME*> &tpl_map_forme, |
377 |
|
|
long &nb_element_2D,long &nb_element_3D, |
378 |
|
|
double& qualite_moyenne_2D, double& qualite_ecart_type_2D, double& qualite_min_2D, double& qualite_max_2D, OT_HISTOGRAMME& histogramme_qualite_2D, |
379 |
|
|
double& qualite_moyenne_3D, double& qualite_ecart_type_3D, double& qualite_min_3D, double& qualite_max_3D, OT_HISTOGRAMME& histogramme_qualite_3D, |
380 |
|
|
double& taille_moyenne_2D, double& taille_ecart_type_2D, double& taille_min_2D, double& taille_max_2D, OT_HISTOGRAMME& histogramme_taille_2D, |
381 |
|
|
double& taille_moyenne_3D, double& taille_ecart_type_3D, double& taille_min_3D, double& taille_max_3D, OT_HISTOGRAMME& histogramme_taille_3D, |
382 |
|
|
double& volume, double& fraction_volumique) |
383 |
couturad |
919 |
{ |
384 |
couturad |
926 |
double volume_ves = boite_VES.get_volume(); |
385 |
|
|
nb_element_2D=0;nb_element_3D=0; |
386 |
couturad |
951 |
qualite_moyenne_2D=0;qualite_ecart_type_2D=0;qualite_min_2D=std::numeric_limits< double >::max();;qualite_max_2D=std::numeric_limits< double >::min(); |
387 |
|
|
qualite_moyenne_3D=0;qualite_ecart_type_3D=0;qualite_min_3D=std::numeric_limits< double >::max();;qualite_max_3D=std::numeric_limits< double >::min(); |
388 |
|
|
taille_moyenne_2D=0;taille_ecart_type_2D=0;taille_min_2D=std::numeric_limits< double >::max();;taille_max_2D=std::numeric_limits< double >::min(); |
389 |
|
|
taille_moyenne_3D=0;taille_ecart_type_3D=0;taille_min_3D=std::numeric_limits< double >::max();;taille_max_3D=std::numeric_limits< double >::min(); |
390 |
couturad |
926 |
volume=0;fraction_volumique=0; |
391 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_MAILLAGE*> tpl_map_element_maill_3D; |
392 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_MAILLAGE*> tpl_map_element_maill_2D; |
393 |
|
|
TPL_MAP_ENTITE<MG_CG_FORME*>::ITERATEUR it_forme; |
394 |
|
|
for(MG_CG_FORME* forme=tpl_map_forme.get_premier(it_forme);forme!=NULL;forme=tpl_map_forme.get_suivant(it_forme)) |
395 |
couturad |
919 |
{ |
396 |
couturad |
926 |
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
397 |
couturad |
919 |
{ |
398 |
couturad |
926 |
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
399 |
|
|
TPL_SET<MG_ELEMENT_MAILLAGE*> *tmp_maill = forme_volume->get_mg_volume()->get_lien_maillage(); |
400 |
|
|
TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it_maill; |
401 |
|
|
for(MG_ELEMENT_MAILLAGE* ele=tmp_maill->get_premier(it_maill);ele!=NULL;ele=tmp_maill->get_suivant(it_maill)) tpl_map_element_maill_3D.ajouter(ele); |
402 |
|
|
TPL_MAP_ENTITE<MG_FACE*> tpl_map_face; |
403 |
|
|
OT_GEOMETRIE::get_map_mg_face_sous_jacent(forme_volume->get_mg_volume(),tpl_map_face); |
404 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face; |
405 |
|
|
for(MG_FACE* face=tpl_map_face.get_premier(it_face);face!=NULL;face=tpl_map_face.get_suivant(it_face)) |
406 |
|
|
{ |
407 |
|
|
tmp_maill = face->get_lien_maillage(); |
408 |
|
|
for(MG_ELEMENT_MAILLAGE* ele=tmp_maill->get_premier(it_maill);ele!=NULL;ele=tmp_maill->get_suivant(it_maill)) tpl_map_element_maill_2D.ajouter(ele); |
409 |
|
|
} |
410 |
|
|
double volume_i; |
411 |
|
|
OT_VECTEUR_3D cdm; |
412 |
|
|
OT_MATRICE_3D inertieglobale; |
413 |
|
|
OT_MATRICE_3D inertiecdm; |
414 |
|
|
forme_volume->get_mg_volume()->get_propriete_massique(mai,volume_i,cdm,inertieglobale,inertiecdm); |
415 |
|
|
volume+=volume_i; |
416 |
couturad |
919 |
} |
417 |
couturad |
926 |
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
418 |
|
|
{ |
419 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
420 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
421 |
|
|
for(MG_VOLUME* vol=forme_multi_volume->get_premier_mg_volume(it_volume);vol!=NULL;vol=forme_multi_volume->get_suivant_mg_volume(it_volume)) |
422 |
|
|
{ |
423 |
|
|
TPL_SET<MG_ELEMENT_MAILLAGE*> *tmp_maill = vol->get_lien_maillage(); |
424 |
|
|
TPL_SET<MG_ELEMENT_MAILLAGE*>::ITERATEUR it_maill; |
425 |
|
|
for(MG_ELEMENT_MAILLAGE* ele=tmp_maill->get_premier(it_maill);ele!=NULL;ele=tmp_maill->get_suivant(it_maill)) tpl_map_element_maill_3D.ajouter(ele); |
426 |
|
|
TPL_MAP_ENTITE<MG_FACE*> tpl_map_face; |
427 |
|
|
OT_GEOMETRIE::get_map_mg_face_sous_jacent(vol,tpl_map_face); |
428 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face; |
429 |
|
|
for(MG_FACE* face=tpl_map_face.get_premier(it_face);face!=NULL;face=tpl_map_face.get_suivant(it_face)) |
430 |
|
|
{ |
431 |
|
|
tmp_maill = face->get_lien_maillage(); |
432 |
|
|
for(MG_ELEMENT_MAILLAGE* ele=tmp_maill->get_premier(it_maill);ele!=NULL;ele=tmp_maill->get_suivant(it_maill)) tpl_map_element_maill_2D.ajouter(ele); |
433 |
|
|
} |
434 |
|
|
double volume_i; |
435 |
|
|
OT_VECTEUR_3D cdm; |
436 |
|
|
OT_MATRICE_3D inertieglobale; |
437 |
|
|
OT_MATRICE_3D inertiecdm; |
438 |
|
|
vol->get_propriete_massique(mai,volume_i,cdm,inertieglobale,inertiecdm); |
439 |
|
|
volume+=volume_i; |
440 |
|
|
} |
441 |
|
|
} |
442 |
couturad |
919 |
} |
443 |
couturad |
926 |
fraction_volumique = volume/volume_ves; |
444 |
|
|
std::vector<double> vector_qualite_3D; |
445 |
|
|
std::vector<double> vector_taille_3D; |
446 |
|
|
LISTE_MG_TETRA::iterator it_tetra; |
447 |
|
|
for(MG_TETRA* tet=mai->get_premier_tetra(it_tetra);tet!=NULL;tet=mai->get_suivant_tetra(it_tetra)) |
448 |
couturad |
919 |
{ |
449 |
couturad |
926 |
if(tpl_map_element_maill_3D.existe(tet)) |
450 |
|
|
{ |
451 |
|
|
double qual=OPERATEUR::qualite_tetra(tet->get_noeud1()->get_coord(),tet->get_noeud2()->get_coord(),tet->get_noeud3()->get_coord(),tet->get_noeud4()->get_coord()); |
452 |
|
|
vector_qualite_3D.push_back(qual); |
453 |
|
|
if(qual<qualite_min_3D) qualite_min_3D=qual; |
454 |
|
|
if(qual>qualite_max_3D) qualite_max_3D=qual; |
455 |
|
|
qualite_moyenne_3D+=qual; |
456 |
|
|
double taille=OPERATEUR::taille_tetra(tet->get_noeud1()->get_coord(),tet->get_noeud2()->get_coord(),tet->get_noeud3()->get_coord(),tet->get_noeud4()->get_coord()); |
457 |
|
|
vector_taille_3D.push_back(taille); |
458 |
|
|
if(taille<taille_min_3D) taille_min_3D=taille; |
459 |
|
|
if(taille>taille_max_3D) taille_max_3D=taille; |
460 |
|
|
taille_moyenne_3D+=taille; |
461 |
|
|
nb_element_3D++; |
462 |
|
|
} |
463 |
|
|
} |
464 |
|
|
qualite_moyenne_3D = qualite_moyenne_3D/nb_element_3D; |
465 |
|
|
taille_moyenne_3D = taille_moyenne_3D/nb_element_3D; |
466 |
|
|
std::vector<double>::iterator it_qual_3D; |
467 |
|
|
|
468 |
|
|
for(it_qual_3D=vector_qualite_3D.begin();it_qual_3D!=vector_qualite_3D.end();it_qual_3D++) |
469 |
|
|
{ |
470 |
|
|
double qual = *it_qual_3D; |
471 |
|
|
qualite_ecart_type_3D+=(qual-qualite_moyenne_3D)*(qual-qualite_moyenne_3D); |
472 |
|
|
histogramme_qualite_3D.ajouter_valeur(qual,1.0/nb_element_3D); |
473 |
couturad |
919 |
} |
474 |
couturad |
926 |
qualite_ecart_type_3D=qualite_ecart_type_3D*(1.0/(nb_element_3D-1.0)); |
475 |
|
|
qualite_ecart_type_3D=sqrt(qualite_ecart_type_3D); |
476 |
|
|
|
477 |
|
|
std::vector<double>::iterator it_taille_3D; |
478 |
|
|
for(it_taille_3D=vector_taille_3D.begin();it_taille_3D!=vector_taille_3D.end();it_taille_3D++) |
479 |
couturad |
919 |
{ |
480 |
couturad |
926 |
double taille = *it_taille_3D; |
481 |
|
|
taille_ecart_type_3D=(taille-taille_moyenne_3D)*(taille-taille_moyenne_3D); |
482 |
|
|
histogramme_taille_3D.ajouter_valeur(taille,1.0/nb_element_3D); |
483 |
|
|
} |
484 |
|
|
taille_ecart_type_3D=taille_ecart_type_3D*(1.0/(nb_element_3D-1.0)); |
485 |
|
|
taille_ecart_type_3D=sqrt(taille_ecart_type_3D); |
486 |
|
|
|
487 |
|
|
|
488 |
|
|
|
489 |
|
|
std::vector<double> vector_qualite_2D; |
490 |
|
|
std::vector<double> vector_taille_2D; |
491 |
|
|
LISTE_MG_TRIANGLE::iterator it_tri; |
492 |
|
|
for(MG_TRIANGLE* tri=mai->get_premier_triangle(it_tri);tri!=NULL;tri=mai->get_suivant_triangle(it_tri)) |
493 |
|
|
{ |
494 |
|
|
if(tpl_map_element_maill_2D.existe(tri)) |
495 |
couturad |
919 |
{ |
496 |
couturad |
926 |
double qual=OPERATEUR::qualite_triangle(tri->get_noeud1()->get_coord(),tri->get_noeud2()->get_coord(),tri->get_noeud3()->get_coord()); |
497 |
|
|
vector_qualite_2D.push_back(qual); |
498 |
|
|
if(qual<qualite_min_2D) qualite_min_2D=qual; |
499 |
|
|
if(qual>qualite_max_2D) qualite_max_2D=qual; |
500 |
|
|
qualite_moyenne_2D+=qual; |
501 |
|
|
double taille=OPERATEUR::taille_triangle(tri->get_noeud1()->get_coord(),tri->get_noeud2()->get_coord(),tri->get_noeud3()->get_coord()); |
502 |
|
|
vector_taille_2D.push_back(taille); |
503 |
|
|
if(taille<taille_min_2D) taille_min_2D=taille; |
504 |
|
|
if(taille>taille_max_2D) taille_max_2D=taille; |
505 |
|
|
taille_moyenne_2D+=taille; |
506 |
|
|
nb_element_2D++; |
507 |
couturad |
919 |
} |
508 |
couturad |
926 |
} |
509 |
|
|
qualite_moyenne_2D = qualite_moyenne_2D/nb_element_2D; |
510 |
|
|
taille_moyenne_2D = taille_moyenne_2D/nb_element_2D; |
511 |
|
|
std::vector<double>::iterator it_qual_2D; |
512 |
|
|
|
513 |
|
|
for(it_qual_2D=vector_qualite_2D.begin();it_qual_2D!=vector_qualite_2D.end();it_qual_2D++) |
514 |
|
|
{ |
515 |
|
|
double qual = *it_qual_2D; |
516 |
|
|
qualite_ecart_type_2D+=(qual-qualite_moyenne_2D)*(qual-qualite_moyenne_2D); |
517 |
|
|
histogramme_qualite_2D.ajouter_valeur(qual,1.0/nb_element_2D); |
518 |
couturad |
919 |
} |
519 |
couturad |
926 |
qualite_ecart_type_2D=qualite_ecart_type_2D*(1.0/(nb_element_2D-1.0)); |
520 |
|
|
qualite_ecart_type_2D=sqrt(qualite_ecart_type_2D); |
521 |
|
|
|
522 |
|
|
std::vector<double>::iterator it_taille_2D; |
523 |
|
|
for(it_taille_2D=vector_taille_2D.begin();it_taille_2D!=vector_taille_2D.end();it_taille_2D++) |
524 |
couturad |
919 |
{ |
525 |
couturad |
926 |
double taille = *it_taille_2D; |
526 |
|
|
taille_ecart_type_2D=(taille-taille_moyenne_2D)*(taille-taille_moyenne_2D); |
527 |
|
|
histogramme_taille_2D.ajouter_valeur(taille,1.0/nb_element_2D); |
528 |
couturad |
919 |
} |
529 |
couturad |
926 |
taille_ecart_type_2D=taille_ecart_type_2D*(1.0/(nb_element_2D-1.0)); |
530 |
|
|
taille_ecart_type_2D=sqrt(taille_ecart_type_2D); |
531 |
|
|
|
532 |
couturad |
919 |
} |
533 |
|
|
|
534 |
|
|
|
535 |
couturad |
951 |
int MSTRUCT_OUTILS::statistiques_fem_maillage(FEM_MAILLAGE* fem, |
536 |
|
|
BOITE_3D *boite_analyse, |
537 |
|
|
TPL_MAP_ENTITE< MG_CG_FORME* >& tpl_map_forme, |
538 |
|
|
long int& nb_element_2D, long int& nb_element_3D, |
539 |
|
|
double& jacobien_min_moyenne_2D, double& jacobien_min_ecart_type_2D, double& jacobien_min_min_2D, double& jacobien_min_max_2D, OT_HISTOGRAMME& histogramme_jacobien_min_2D, |
540 |
|
|
double& jacobien_max_moyenne_2D, double& jacobien_max_ecart_type_2D, double& jacobien_max_min_2D, double& jacobien_max_max_2D, OT_HISTOGRAMME& histogramme_jacobien_max_2D, |
541 |
|
|
double& jacobien_min_moyenne_3D, double& jacobien_min_ecart_type_3D, double& jacobien_min_min_3D, double& jacobien_min_max_3D, OT_HISTOGRAMME& histogramme_jacobien_min_3D, |
542 |
|
|
double& jacobien_max_moyenne_3D, double& jacobien_max_ecart_type_3D, double& jacobien_max_min_3D, double& jacobien_max_max_3D, OT_HISTOGRAMME& histogramme_jacobien_max_3D, |
543 |
|
|
double& distortion_moyenne_2D, double& distortion_ecart_type_2D, double& distortion_min_2D, double& distortion_max_2D, OT_HISTOGRAMME& histogramme_distortion_2D, |
544 |
|
|
double& distortion_moyenne_3D, double& distortion_ecart_type_3D, double& distortion_min_3D, double& distortion_max_3D, OT_HISTOGRAMME& histogramme_distortion_3D, |
545 |
|
|
double& volume, |
546 |
|
|
double& fraction_volumique) |
547 |
couturad |
919 |
{ |
548 |
couturad |
931 |
double volume_ves=0; |
549 |
couturad |
926 |
nb_element_2D=0;nb_element_3D=0; |
550 |
couturad |
951 |
jacobien_min_moyenne_2D=0.0; jacobien_min_ecart_type_2D=0.0; jacobien_min_min_2D=std::numeric_limits< double >::max(); jacobien_min_max_2D=std::numeric_limits< double >::min(); |
551 |
|
|
jacobien_max_moyenne_2D=0.0; jacobien_max_ecart_type_2D=0.0; jacobien_max_min_2D=std::numeric_limits< double >::max(); jacobien_max_max_2D=std::numeric_limits< double >::min(); |
552 |
|
|
jacobien_min_moyenne_3D=0.0; jacobien_min_ecart_type_3D=0.0; jacobien_min_min_3D=std::numeric_limits< double >::max(); jacobien_min_max_3D=std::numeric_limits< double >::min(); |
553 |
|
|
jacobien_max_moyenne_3D=0.0; jacobien_max_ecart_type_3D=0.0; jacobien_max_min_3D=std::numeric_limits< double >::max(); jacobien_max_max_3D=std::numeric_limits< double >::min(); |
554 |
|
|
distortion_moyenne_2D=0.0; distortion_ecart_type_2D=0.0; distortion_min_2D=std::numeric_limits< double >::max(); distortion_max_2D=std::numeric_limits< double >::min(); |
555 |
|
|
distortion_moyenne_3D=0.0; distortion_ecart_type_3D=0.0; distortion_min_3D=std::numeric_limits< double >::max(); distortion_max_3D=std::numeric_limits< double >::min(); |
556 |
couturad |
926 |
volume=0; |
557 |
|
|
fraction_volumique=0; |
558 |
|
|
|
559 |
couturad |
931 |
LISTE_FEM_ELEMENT3::iterator it_element3; |
560 |
|
|
for(FEM_ELEMENT3* ele3=fem->get_premier_element3(it_element3);ele3!=NULL;ele3=fem->get_suivant_element3(it_element3)) |
561 |
|
|
{ |
562 |
|
|
BOITE_3D b3d_ele = ele3->get_boite_3D(); |
563 |
|
|
if(boite_analyse!=NULL) |
564 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
565 |
|
|
int nb_pt_gauss=ele3->get_nb_pt_gauss(ele3->get_degremax_fonction_interpolation()); |
566 |
|
|
for (int r=0;r<nb_pt_gauss;r++) |
567 |
|
|
{ |
568 |
|
|
int degre=ele3->get_degre_gauss(nb_pt_gauss); |
569 |
|
|
double w; |
570 |
|
|
double uvw[3]; |
571 |
|
|
ele3->get_pt_gauss(degre,r,w,uvw); |
572 |
|
|
double jac[9]; |
573 |
|
|
int l,c; |
574 |
|
|
double det=ele3->get_jacobien(jac,uvw,l,c); |
575 |
|
|
volume_ves+=w*det; |
576 |
|
|
} |
577 |
|
|
} |
578 |
couturad |
926 |
TPL_MAP_ENTITE<FEM_ELEMENT3*> tpl_map_element_maill_3D; |
579 |
|
|
TPL_MAP_ENTITE<FEM_ELEMENT2*> tpl_map_element_maill_2D; |
580 |
|
|
TPL_MAP_ENTITE<MG_CG_FORME*>::ITERATEUR it_forme; |
581 |
|
|
for(MG_CG_FORME* forme=tpl_map_forme.get_premier(it_forme);forme!=NULL;forme=tpl_map_forme.get_suivant(it_forme)) |
582 |
couturad |
919 |
{ |
583 |
couturad |
926 |
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
584 |
couturad |
919 |
{ |
585 |
couturad |
926 |
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
586 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *tmp_maill = forme_volume->get_mg_volume()->get_lien_fem_maillage(); |
587 |
|
|
long tmp_nb = tmp_maill->get_nb(); |
588 |
|
|
for(long i=0;i<tmp_nb;i++) |
589 |
couturad |
919 |
{ |
590 |
couturad |
926 |
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)tmp_maill->get(i); |
591 |
|
|
BOITE_3D b3d_ele = ele3->get_boite_3D(); |
592 |
|
|
if(boite_analyse!=NULL) |
593 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
594 |
|
|
tpl_map_element_maill_3D.ajouter(ele3); |
595 |
couturad |
919 |
} |
596 |
couturad |
926 |
TPL_MAP_ENTITE<MG_FACE*> tpl_map_face; |
597 |
|
|
OT_GEOMETRIE::get_map_mg_face_sous_jacent(forme_volume->get_mg_volume(),tpl_map_face); |
598 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face; |
599 |
|
|
for(MG_FACE* face=tpl_map_face.get_premier(it_face);face!=NULL;face=tpl_map_face.get_suivant(it_face)) |
600 |
couturad |
919 |
{ |
601 |
couturad |
926 |
tmp_maill = face->get_lien_fem_maillage(); |
602 |
|
|
tmp_nb = tmp_maill->get_nb(); |
603 |
|
|
for(long i=0;i<tmp_nb;i++) |
604 |
couturad |
919 |
{ |
605 |
couturad |
926 |
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)tmp_maill->get(i); |
606 |
|
|
BOITE_3D b3d_ele = ele2->get_boite_3D(); |
607 |
|
|
if(boite_analyse!=NULL) |
608 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
609 |
|
|
tpl_map_element_maill_2D.ajouter(ele2); |
610 |
couturad |
919 |
} |
611 |
|
|
} |
612 |
|
|
} |
613 |
couturad |
926 |
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
614 |
|
|
{ |
615 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
616 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
617 |
|
|
for(MG_VOLUME* vol=forme_multi_volume->get_premier_mg_volume(it_volume);vol!=NULL;vol=forme_multi_volume->get_suivant_mg_volume(it_volume)) |
618 |
|
|
{ |
619 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *tmp_maill = vol->get_lien_fem_maillage(); |
620 |
|
|
long tmp_nb = tmp_maill->get_nb(); |
621 |
|
|
for(long i=0;i<tmp_nb;i++) |
622 |
|
|
{ |
623 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)tmp_maill->get(i); |
624 |
|
|
BOITE_3D b3d_ele = ele3->get_boite_3D(); |
625 |
|
|
if(boite_analyse!=NULL) |
626 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
627 |
|
|
tpl_map_element_maill_3D.ajouter(ele3); |
628 |
|
|
} |
629 |
|
|
TPL_MAP_ENTITE<MG_FACE*> tpl_map_face; |
630 |
|
|
OT_GEOMETRIE::get_map_mg_face_sous_jacent(vol,tpl_map_face); |
631 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face; |
632 |
|
|
for(MG_FACE* face=tpl_map_face.get_premier(it_face);face!=NULL;face=tpl_map_face.get_suivant(it_face)) |
633 |
|
|
{ |
634 |
|
|
tmp_maill = face->get_lien_fem_maillage(); |
635 |
|
|
tmp_nb = tmp_maill->get_nb(); |
636 |
|
|
for(long i=0;i<tmp_nb;i++) |
637 |
|
|
{ |
638 |
|
|
FEM_ELEMENT2* ele2 = (FEM_ELEMENT2*)tmp_maill->get(i); |
639 |
|
|
BOITE_3D b3d_ele = ele2->get_boite_3D(); |
640 |
|
|
if(boite_analyse!=NULL) |
641 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
642 |
|
|
tpl_map_element_maill_2D.ajouter(ele2); |
643 |
|
|
} |
644 |
|
|
} |
645 |
|
|
} |
646 |
|
|
} |
647 |
couturad |
919 |
} |
648 |
couturad |
926 |
nb_element_3D=tpl_map_element_maill_3D.get_nb(); |
649 |
|
|
nb_element_2D=tpl_map_element_maill_2D.get_nb(); |
650 |
|
|
std::vector<double> vector_jacobien_min_2D; |
651 |
|
|
std::vector<double> vector_jacobien_max_2D; |
652 |
|
|
std::vector<double> vector_jacobien_min_3D; |
653 |
|
|
std::vector<double> vector_jacobien_max_3D; |
654 |
|
|
std::vector<double> vector_distortion_2D; |
655 |
|
|
std::vector<double> vector_distortion_3D; |
656 |
|
|
FEM_MAILLAGE_QUADRATIQUE_OUTILS ot; |
657 |
|
|
TPL_MAP_ENTITE<FEM_ELEMENT3*>::ITERATEUR it_ele3; |
658 |
|
|
for(FEM_ELEMENT3* ele3=tpl_map_element_maill_3D.get_premier(it_ele3);ele3!=NULL;ele3=tpl_map_element_maill_3D.get_suivant(it_ele3)) |
659 |
couturad |
919 |
{ |
660 |
couturad |
926 |
int nb_pt_gauss=ele3->get_nb_pt_gauss(ele3->get_degremax_fonction_interpolation()); |
661 |
|
|
for (int r=0;r<nb_pt_gauss;r++) |
662 |
|
|
{ |
663 |
|
|
int degre=ele3->get_degre_gauss(nb_pt_gauss); |
664 |
|
|
double w; |
665 |
|
|
double uvw[3]; |
666 |
|
|
ele3->get_pt_gauss(degre,r,w,uvw); |
667 |
|
|
double jac[9]; |
668 |
|
|
int l,c; |
669 |
|
|
double det=ele3->get_jacobien(jac,uvw,l,c); |
670 |
|
|
volume+=w*det; |
671 |
|
|
} |
672 |
|
|
double jmin=ot.get_jmin(ele3); |
673 |
|
|
double jmax=ot.get_jmin(ele3); |
674 |
|
|
double distortion = ot.get_distorsion2(ele3); |
675 |
|
|
vector_jacobien_min_3D.push_back(jmin); |
676 |
|
|
vector_jacobien_max_3D.push_back(jmax); |
677 |
|
|
vector_distortion_3D.push_back(distortion); |
678 |
|
|
jacobien_min_moyenne_3D+=jmin; |
679 |
|
|
jacobien_max_moyenne_3D+=jmax; |
680 |
|
|
distortion_moyenne_3D+=distortion; |
681 |
couturad |
919 |
} |
682 |
couturad |
926 |
fraction_volumique=volume/volume_ves; |
683 |
|
|
jacobien_min_moyenne_3D=jacobien_min_moyenne_3D/nb_element_3D; |
684 |
|
|
jacobien_max_moyenne_3D=jacobien_max_moyenne_3D/nb_element_3D; |
685 |
|
|
distortion_moyenne_3D=distortion_moyenne_3D/nb_element_3D; |
686 |
|
|
std::vector<double>::iterator it_jac_min_3D=vector_jacobien_min_3D.begin(); |
687 |
|
|
std::vector<double>::iterator it_jac_max_3D=vector_jacobien_max_3D.begin(); |
688 |
|
|
std::vector<double>::iterator it_dist_3D=vector_distortion_3D.begin(); |
689 |
|
|
for(long i=0;i<nb_element_3D;i++) |
690 |
couturad |
919 |
{ |
691 |
couturad |
926 |
double jmin=*it_jac_min_3D; |
692 |
|
|
double jmax=*it_jac_max_3D; |
693 |
|
|
double dist=*it_dist_3D; |
694 |
|
|
if(jmin<jacobien_min_min_3D)jacobien_min_min_3D=jmin; |
695 |
|
|
if(jmin>jacobien_min_max_3D)jacobien_min_max_3D=jmin; |
696 |
|
|
if(jmax<jacobien_max_min_3D)jacobien_max_min_3D=jmax; |
697 |
|
|
if(jmax>jacobien_max_max_3D)jacobien_max_max_3D=jmax; |
698 |
|
|
if(dist<distortion_min_3D)distortion_min_3D=dist; |
699 |
|
|
if(dist>distortion_max_3D)distortion_max_3D=dist; |
700 |
|
|
jacobien_min_ecart_type_3D=(jmin-jacobien_min_moyenne_3D)*(jmin-jacobien_min_moyenne_3D); |
701 |
|
|
jacobien_max_ecart_type_3D=(jmax-jacobien_max_moyenne_3D)*(jmax-jacobien_max_moyenne_3D); |
702 |
|
|
distortion_ecart_type_3D=(dist-distortion_moyenne_3D)*(dist-distortion_moyenne_3D); |
703 |
|
|
histogramme_jacobien_min_3D.ajouter_valeur(jmin,1.0/nb_element_3D); |
704 |
|
|
histogramme_jacobien_max_3D.ajouter_valeur(jmax,1.0/nb_element_3D); |
705 |
|
|
histogramme_distortion_3D.ajouter_valeur(dist,1.0/nb_element_3D); |
706 |
|
|
it_jac_min_3D++; |
707 |
|
|
it_jac_max_3D++; |
708 |
|
|
it_dist_3D++; |
709 |
couturad |
919 |
} |
710 |
couturad |
926 |
jacobien_min_ecart_type_3D=sqrt(jacobien_min_ecart_type_3D*(1.0/(nb_element_3D-1.0))); |
711 |
|
|
jacobien_max_ecart_type_3D=sqrt(jacobien_max_ecart_type_3D*(1.0/(nb_element_3D-1.0))); |
712 |
|
|
distortion_ecart_type_3D=sqrt(distortion_ecart_type_3D*(1.0/(nb_element_3D-1.0))); |
713 |
|
|
|
714 |
|
|
TPL_MAP_ENTITE<FEM_ELEMENT2*>::ITERATEUR it_ele2; |
715 |
|
|
for(FEM_ELEMENT2* ele2=tpl_map_element_maill_2D.get_premier(it_ele2);ele2!=NULL;ele2=tpl_map_element_maill_2D.get_suivant(it_ele2)) |
716 |
couturad |
919 |
{ |
717 |
couturad |
926 |
double jmin=ot.get_jmin(ele2); |
718 |
|
|
double jmax=ot.get_jmin(ele2); |
719 |
|
|
double distortion = ot.get_distorsion2(ele2); |
720 |
|
|
vector_jacobien_min_2D.push_back(jmin); |
721 |
|
|
vector_jacobien_max_2D.push_back(jmax); |
722 |
|
|
vector_distortion_2D.push_back(distortion); |
723 |
|
|
jacobien_min_moyenne_2D+=jmin; |
724 |
|
|
jacobien_max_moyenne_2D+=jmax; |
725 |
|
|
distortion_moyenne_2D+=distortion; |
726 |
couturad |
919 |
} |
727 |
couturad |
926 |
jacobien_min_moyenne_2D=jacobien_min_moyenne_2D/nb_element_2D; |
728 |
|
|
jacobien_max_moyenne_2D=jacobien_max_moyenne_2D/nb_element_2D; |
729 |
|
|
distortion_moyenne_2D=distortion_moyenne_2D/nb_element_2D; |
730 |
|
|
std::vector<double>::iterator it_jac_min_2D=vector_jacobien_min_2D.begin(); |
731 |
|
|
std::vector<double>::iterator it_jac_max_2D=vector_jacobien_max_2D.begin(); |
732 |
|
|
std::vector<double>::iterator it_dist_2D=vector_distortion_2D.begin(); |
733 |
|
|
for(long i=0;i<nb_element_2D;i++) |
734 |
couturad |
919 |
{ |
735 |
couturad |
926 |
double jmin=*it_jac_min_2D; |
736 |
|
|
double jmax=*it_jac_max_2D; |
737 |
|
|
double dist=*it_dist_2D; |
738 |
|
|
if(jmin<jacobien_min_min_2D)jacobien_min_min_2D=jmin; |
739 |
|
|
if(jmin>jacobien_min_max_2D)jacobien_min_max_2D=jmin; |
740 |
|
|
if(jmax<jacobien_max_min_2D)jacobien_max_min_2D=jmax; |
741 |
|
|
if(jmax>jacobien_max_max_2D)jacobien_max_max_2D=jmax; |
742 |
|
|
if(dist<distortion_min_2D)distortion_min_2D=dist; |
743 |
|
|
if(dist>distortion_max_2D)distortion_max_2D=dist; |
744 |
|
|
jacobien_min_ecart_type_2D=(jmin-jacobien_min_moyenne_2D)*(jmin-jacobien_min_moyenne_2D); |
745 |
|
|
jacobien_max_ecart_type_2D=(jmax-jacobien_max_moyenne_2D)*(jmax-jacobien_max_moyenne_2D); |
746 |
|
|
distortion_ecart_type_2D=(dist-distortion_moyenne_2D)*(dist-distortion_moyenne_2D); |
747 |
|
|
histogramme_jacobien_min_2D.ajouter_valeur(jmin,1.0/nb_element_2D); |
748 |
|
|
histogramme_jacobien_max_2D.ajouter_valeur(jmax,1.0/nb_element_2D); |
749 |
|
|
histogramme_distortion_2D.ajouter_valeur(dist,1.0/nb_element_2D); |
750 |
|
|
it_jac_min_2D++; |
751 |
|
|
it_jac_max_2D++; |
752 |
|
|
it_dist_2D++; |
753 |
couturad |
919 |
} |
754 |
couturad |
926 |
jacobien_min_ecart_type_2D=sqrt(jacobien_min_ecart_type_2D*(1.0/(nb_element_2D-1.0))); |
755 |
|
|
jacobien_max_ecart_type_2D=sqrt(jacobien_max_ecart_type_2D*(1.0/(nb_element_2D-1.0))); |
756 |
|
|
distortion_ecart_type_2D=sqrt(distortion_ecart_type_2D*(1.0/(nb_element_2D-1.0))); |
757 |
couturad |
919 |
} |
758 |
|
|
|
759 |
|
|
|
760 |
couturad |
951 |
double MSTRUCT_OUTILS::get_volume_mgcg_forme(MG_CG_FORME* forme, FEM_MAILLAGE* fem,BOITE_3D* boite_analyse) |
761 |
|
|
{ |
762 |
|
|
TPL_MAP_ENTITE<FEM_ELEMENT3*> tpl_map_element_maill_3D; |
763 |
|
|
if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME) |
764 |
|
|
{ |
765 |
|
|
MG_CG_FORME_VOLUME* forme_volume = (MG_CG_FORME_VOLUME*)forme; |
766 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *tmp_maill = forme_volume->get_mg_volume()->get_lien_fem_maillage(); |
767 |
|
|
long tmp_nb = tmp_maill->get_nb(); |
768 |
|
|
for(long i=0;i<tmp_nb;i++) |
769 |
|
|
{ |
770 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)tmp_maill->get(i); |
771 |
|
|
BOITE_3D b3d_ele = ele3->get_boite_3D(); |
772 |
|
|
if(boite_analyse!=NULL) |
773 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
774 |
|
|
tpl_map_element_maill_3D.ajouter(ele3); |
775 |
|
|
} |
776 |
|
|
} |
777 |
|
|
else if(forme->get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME) |
778 |
|
|
{ |
779 |
|
|
MG_CG_FORME_MULTI_VOLUME* forme_multi_volume = (MG_CG_FORME_MULTI_VOLUME*)forme; |
780 |
|
|
std::map<long,MG_VOLUME*>::iterator it_volume; |
781 |
|
|
for(MG_VOLUME* vol=forme_multi_volume->get_premier_mg_volume(it_volume);vol!=NULL;vol=forme_multi_volume->get_suivant_mg_volume(it_volume)) |
782 |
|
|
{ |
783 |
|
|
TPL_LISTE_ENTITE<FEM_ELEMENT_MAILLAGE*> *tmp_maill = vol->get_lien_fem_maillage(); |
784 |
|
|
long tmp_nb = tmp_maill->get_nb(); |
785 |
|
|
for(long i=0;i<tmp_nb;i++) |
786 |
|
|
{ |
787 |
|
|
FEM_ELEMENT3* ele3 = (FEM_ELEMENT3*)tmp_maill->get(i); |
788 |
|
|
BOITE_3D b3d_ele = ele3->get_boite_3D(); |
789 |
|
|
if(boite_analyse!=NULL) |
790 |
|
|
if(!boite_analyse->contient(b3d_ele.get_xcentre(),b3d_ele.get_ycentre(),b3d_ele.get_zcentre())) continue; |
791 |
|
|
tpl_map_element_maill_3D.ajouter(ele3); |
792 |
|
|
} |
793 |
|
|
} |
794 |
|
|
} |
795 |
|
|
double volume=0; |
796 |
|
|
TPL_MAP_ENTITE<FEM_ELEMENT3*>::ITERATEUR it_ele3; |
797 |
|
|
for(FEM_ELEMENT3* ele3=tpl_map_element_maill_3D.get_premier(it_ele3);ele3!=NULL;ele3=tpl_map_element_maill_3D.get_suivant(it_ele3)) |
798 |
|
|
{ |
799 |
|
|
int nb_pt_gauss=ele3->get_nb_pt_gauss(ele3->get_degremax_fonction_interpolation()); |
800 |
|
|
for (int r=0;r<nb_pt_gauss;r++) |
801 |
|
|
{ |
802 |
|
|
int degre=ele3->get_degre_gauss(nb_pt_gauss); |
803 |
|
|
double w; |
804 |
|
|
double uvw[3]; |
805 |
|
|
ele3->get_pt_gauss(degre,r,w,uvw); |
806 |
|
|
double jac[9]; |
807 |
|
|
int l,c; |
808 |
|
|
double det=ele3->get_jacobien(jac,uvw,l,c); |
809 |
|
|
volume+=w*det; |
810 |
|
|
} |
811 |
|
|
} |
812 |
|
|
return volume; |
813 |
|
|
} |
814 |
couturad |
919 |
|
815 |
couturad |
982 |
int MSTRUCT_OUTILS::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, double valeur,bool topo_sous_jacente) |
816 |
|
|
{ |
817 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan; |
818 |
|
|
for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan)) |
819 |
|
|
{ |
820 |
|
|
face->ajouter_ccf(condition,valeur); |
821 |
|
|
if(topo_sous_jacente==true) |
822 |
|
|
{ |
823 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo; |
824 |
|
|
face->get_topologie_sousjacente(&map_topo); |
825 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo; |
826 |
|
|
for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo)) |
827 |
|
|
{ |
828 |
|
|
topo->ajouter_ccf(condition,valeur); |
829 |
|
|
} |
830 |
|
|
} |
831 |
|
|
} |
832 |
|
|
} |
833 |
couturad |
919 |
|
834 |
couturad |
982 |
int MSTRUCT_OUTILS::appliquer_conditions_limites_plan(TPL_MAP_ENTITE< MG_FACE* >* plan, char* condition, std::string formule,std::vector<std::string> &listvariable,bool topo_sous_jacente) |
835 |
|
|
{ |
836 |
|
|
TPL_MAP_ENTITE<MG_FACE*>::ITERATEUR it_face_plan; |
837 |
|
|
for(MG_FACE *face = plan->get_premier(it_face_plan);face!=NULL;face=plan->get_suivant(it_face_plan)) |
838 |
|
|
{ |
839 |
|
|
face->ajouter_ccf(condition,formule,listvariable); |
840 |
|
|
if(topo_sous_jacente==true) |
841 |
|
|
{ |
842 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> map_topo; |
843 |
|
|
face->get_topologie_sousjacente(&map_topo); |
844 |
|
|
TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*>::ITERATEUR it_topo; |
845 |
|
|
for(MG_ELEMENT_TOPOLOGIQUE *topo=map_topo.get_premier(it_topo);topo!=NULL;topo=map_topo.get_suivant(it_topo)) |
846 |
|
|
{ |
847 |
|
|
topo->ajouter_ccf(condition,formule,listvariable); |
848 |
|
|
} |
849 |
|
|
} |
850 |
|
|
} |
851 |
|
|
} |
852 |
couturad |
919 |
|
853 |
couturad |
982 |
int MSTRUCT_OUTILS::appliquer_conditions_limites(MG_GEOMETRIE* m_mg_geometrie,BOITE_3D boite3D_ves,int Type_etude, int Type_CL, int Type_Chargement, double Valeur_CL, int Direction, double eps) |
854 |
|
|
{ |
855 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xy_z0; |
856 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xy_z1; |
857 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_yz_x0; |
858 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_yz_x1; |
859 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xz_y0; |
860 |
|
|
TPL_MAP_ENTITE<MG_FACE*> plan_xz_y1; |
861 |
|
|
std::map<unsigned long,MG_FACE*,std::less<unsigned long>>::iterator it_face; |
862 |
|
|
for(MG_FACE *face = m_mg_geometrie->get_premier_face(it_face);face!=NULL;face=m_mg_geometrie->get_suivant_face(it_face)) |
863 |
|
|
{ |
864 |
|
|
double xyzmin[3]; |
865 |
|
|
double xyzmax[3]; |
866 |
|
|
face->get_xyz_min_max(xyzmin,xyzmax,16); |
867 |
|
|
|
868 |
|
|
if(OPERATEUR::egal(xyzmin[0],boite3D_ves.get_xmin(),eps) && OPERATEUR::egal(xyzmax[0],boite3D_ves.get_xmin(),eps)) plan_yz_x0.ajouter(face); |
869 |
|
|
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); |
870 |
|
|
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); |
871 |
|
|
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); |
872 |
|
|
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); |
873 |
|
|
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); |
874 |
|
|
} |
875 |
|
|
MG_SOMMET* sommet_origine; |
876 |
|
|
MG_SOMMET* sommet_x1y0z0; |
877 |
|
|
MG_SOMMET* sommet_x0y1z0; |
878 |
|
|
MG_SOMMET* sommet_x0y0z1; |
879 |
|
|
std::map<unsigned long,MG_SOMMET*,std::less<unsigned long>>::iterator it_sommet; |
880 |
|
|
for(MG_SOMMET* som=m_mg_geometrie->get_premier_sommet(it_sommet);som!=NULL;som=m_mg_geometrie->get_suivant_sommet(it_sommet)) |
881 |
|
|
{ |
882 |
|
|
double xyz[3]; |
883 |
|
|
som->get_point()->evaluer(xyz); |
884 |
|
|
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; |
885 |
|
|
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; |
886 |
|
|
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; |
887 |
|
|
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; |
888 |
|
|
} |
889 |
|
|
if(Type_etude==MSTRUCT::TYPE_ETUDE::MECANIQUE) |
890 |
|
|
{ |
891 |
|
|
if(Type_Chargement==MSTRUCT::TYPE_CHARGEMENT::SPHERIQUE) |
892 |
|
|
{ |
893 |
|
|
if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE) |
894 |
|
|
{ |
895 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true); |
896 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",Valeur_CL,true); |
897 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true); |
898 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",Valeur_CL,true); |
899 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true); |
900 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",Valeur_CL,true); |
901 |
|
|
} |
902 |
|
|
else if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE) |
903 |
|
|
{ |
904 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",0.0,true); |
905 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Pz",Valeur_CL,false); |
906 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",0.0,true); |
907 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Px",Valeur_CL,false); |
908 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",0.0,true); |
909 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Py",Valeur_CL,false); |
910 |
|
|
} |
911 |
|
|
} |
912 |
|
|
else if(Type_Chargement==MSTRUCT::TYPE_CHARGEMENT::DEVIATORIQUE) |
913 |
|
|
{ |
914 |
|
|
if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::DEFORMATION_HOMOGENE) |
915 |
|
|
{ |
916 |
|
|
char chr_valeur_cl[1000]; |
917 |
|
|
sprintf(chr_valeur_cl,"%lf",Valeur_CL); |
918 |
|
|
std::string str_valeur_cl = chr_valeur_cl; |
919 |
|
|
std::string formule_Dx = str_valeur_cl+ "*Y"; |
920 |
|
|
std::string formule_Dy = str_valeur_cl+ "*Z"; |
921 |
|
|
std::string formule_Dz = str_valeur_cl+ "*X"; |
922 |
|
|
std::vector<std::string> liste_variable_formule_Dx; |
923 |
|
|
std::vector<std::string> liste_variable_formule_Dy; |
924 |
|
|
std::vector<std::string> liste_variable_formule_Dz; |
925 |
|
|
liste_variable_formule_Dx.push_back((std::string)"Y"); |
926 |
|
|
liste_variable_formule_Dy.push_back((std::string)"Z"); |
927 |
|
|
liste_variable_formule_Dz.push_back((std::string)"X"); |
928 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
929 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
930 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
931 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
932 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
933 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
934 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
935 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
936 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
937 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
938 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
939 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
940 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
941 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
942 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
943 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dx",formule_Dx,liste_variable_formule_Dx,true); |
944 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dy",formule_Dy,liste_variable_formule_Dy,true); |
945 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Dz",formule_Dz,liste_variable_formule_Dz,true); |
946 |
|
|
} |
947 |
|
|
else if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::CONTRAINTE_HOMOGENE) |
948 |
|
|
{ |
949 |
|
|
sommet_origine->ajouter_ccf((char*)"Dt",0.0); |
950 |
|
|
sommet_x1y0z0->ajouter_ccf((char*)"Dy",0.0); |
951 |
|
|
sommet_x1y0z0->ajouter_ccf((char*)"Dz",0.0); |
952 |
|
|
sommet_x0y1z0->ajouter_ccf((char*)"Dz",0.0); |
953 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Px",-Valeur_CL,false); |
954 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Py",-Valeur_CL,false); |
955 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Px",Valeur_CL,false); |
956 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Py",Valeur_CL,false); |
957 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Px",-Valeur_CL,false); |
958 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Pz",-Valeur_CL,false); |
959 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Px",Valeur_CL,false); |
960 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Pz",Valeur_CL,false); |
961 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Py",-Valeur_CL,false); |
962 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Pz",-Valeur_CL,false); |
963 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Py",Valeur_CL,false); |
964 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Pz",Valeur_CL,false); |
965 |
|
|
} |
966 |
|
|
} |
967 |
|
|
} |
968 |
|
|
else if(Type_etude==MSTRUCT::TYPE_ETUDE::THERMIQUE) |
969 |
|
|
{ |
970 |
|
|
if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::GRADIENT_TEMPERATURE) |
971 |
|
|
{ |
972 |
|
|
if(Direction==0) |
973 |
|
|
{ |
974 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"Tn",0.0,false); |
975 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"Tn",Valeur_CL,false); |
976 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"fn",0.0,false); |
977 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"fn",0.0,false); |
978 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"fn",0.0,false); |
979 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"fn",0.0,false); |
980 |
|
|
} |
981 |
|
|
else if(Direction==1) |
982 |
|
|
{ |
983 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"fn",0.0,false); |
984 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"fn",0.0,false); |
985 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"fn",0.0,false); |
986 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"fn",0.0,false); |
987 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"Tn",0.0,false); |
988 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"Tn",Valeur_CL,false); |
989 |
|
|
} |
990 |
|
|
else if(Direction==2) |
991 |
|
|
{ |
992 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"fn",0.0,false); |
993 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"fn",0.0,false); |
994 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"Tn",0.0,false); |
995 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"Tn",Valeur_CL,false); |
996 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"fn",0.0,false); |
997 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"fn",0.0,false); |
998 |
|
|
} |
999 |
|
|
} |
1000 |
|
|
else if(Type_CL==MSTRUCT::TYPE_CONDITIONS_LIMITES::FLUX_CHALEUR) |
1001 |
|
|
{ |
1002 |
|
|
if(Direction==0) |
1003 |
|
|
{ |
1004 |
|
|
sommet_origine->ajouter_ccf((char*)"Tn",0.0); |
1005 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"fn",Valeur_CL,false); |
1006 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"fn",-Valeur_CL,false); |
1007 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"fn",0.0,false); |
1008 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"fn",0.0,false); |
1009 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"fn",0.0,false); |
1010 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"fn",0.0,false); |
1011 |
|
|
} |
1012 |
|
|
else if(Direction==1) |
1013 |
|
|
{ |
1014 |
|
|
sommet_origine->ajouter_ccf((char*)"Tn",0.0); |
1015 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"fn",0.0,false); |
1016 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"fn",0.0,false); |
1017 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"fn",0.0,false); |
1018 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"fn",0.0,false); |
1019 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"fn",Valeur_CL,false); |
1020 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"fn",-Valeur_CL,false); |
1021 |
|
|
} |
1022 |
|
|
else if(Direction==2) |
1023 |
|
|
{ |
1024 |
|
|
sommet_origine->ajouter_ccf((char*)"Tn",0.0); |
1025 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x0,(char*)"fn",0.0,false); |
1026 |
|
|
appliquer_conditions_limites_plan(&plan_yz_x1,(char*)"fn",0.0,false); |
1027 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z0,(char*)"fn",Valeur_CL,false); |
1028 |
|
|
appliquer_conditions_limites_plan(&plan_xy_z1,(char*)"fn",-Valeur_CL,false); |
1029 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y0,(char*)"fn",0.0,false); |
1030 |
|
|
appliquer_conditions_limites_plan(&plan_xz_y1,(char*)"fn",0.0,false); |
1031 |
|
|
} |
1032 |
|
|
} |
1033 |
|
|
} |
1034 |
|
|
} |
1035 |
couturad |
919 |
|
1036 |
|
|
|
1037 |
|
|
|
1038 |
|
|
|
1039 |
|
|
|
1040 |
couturad |
982 |
|
1041 |
|
|
|