43 MAILLEUR3D_STRUCTURE::MAILLEUR3D_STRUCTURE(
double xmintmp,
double xmaxtmp,
double ymintmp,
double ymaxtmp,
double zmintmp,
double zmaxtmp,
int ntmp,
int mtmp,
int ktmp,
MG_GESTIONNAIRE*gesttmp,
int avecgeo,
double unit):
MAILLEUR(false),xmin(xmintmp),xmax(xmaxtmp),ymin(ymintmp),ymax(ymaxtmp),zmin(zmintmp),zmax(zmaxtmp),n(ntmp),
m(mtmp),k(ktmp),gest(gesttmp),geovirtuel(avecgeo),densitevariable(false),unite(unit),nbfonction(0)
46 MAILLEUR3D_STRUCTURE::MAILLEUR3D_STRUCTURE(
double xmintmp,
double xmaxtmp,
double ymintmp,
double ymaxtmp,
double zmintmp,
double zmaxtmp,
double (*fx)(
double),
double (*fy)(
double),
double (*fz)(
double),
MG_GESTIONNAIRE* gesttmp,
int avecgeo,
double unit):
MAILLEUR(false),xmin(xmintmp),xmax(xmaxtmp),ymin(ymintmp),ymax(ymaxtmp),zmin(zmintmp),zmax(zmaxtmp),gest(gesttmp),geovirtuel(avecgeo),enx(fx),eny(fy),enz(fz),densitevariable(true),unite(unit),nbfonction(0)
51 xmin(mdd.xmin),xmax(mdd.xmax),ymin(mdd.ymin),ymax(mdd.ymax),zmin(mdd.zmin),zmax(mdd.zmax),n(mdd.n),
m(mdd.
m),k(mdd.k),gest(mdd.gest),nbfonction(mdd.nbfonction)
64 std::vector<integrale> tab_integrale;
66 double longueur_metrique=0.;
74 t=0.7886751345*ti+0.2113248654*tii;
75 double facteur1=(max-min)/(*en)(t);
76 t=0.7886751345*tii+0.2113248654*ti;
77 double facteur2=(max-min)/(*en)(t);
78 longueur_metrique=longueur_metrique+0.5*(tii-ti)*(facteur1+facteur2);
81 pas.li=longueur_metrique;
82 tab_integrale.insert(tab_integrale.end(),
pas);
85 nb=(int)floor(longueur_metrique);
86 if (longueur_metrique-floor(longueur_metrique)>0.5) nb++;
88 double valeur_cible=longueur_metrique/nb;
91 int nb_pas_integrale=tab_integrale.size();
92 for (
int i=0;i<nb_pas_integrale;i++)
94 while ((tab_integrale[i].li>(nbcree+1)*valeur_cible) && (nbcree<nb-1))
96 double ti=tab_integrale[i].ti;
99 if (i!=0) li=tab_integrale[i-1].li;
100 double lii=tab_integrale[i].li;
101 if (i!=nb_pas_integrale-1) tii=tab_integrale[i+1].ti;
102 t=ti+(tii-ti)/(lii-li)*((nbcree+1)*valeur_cible-li);
103 double x=min+t*(max-min);
118 affiche((
char*)
"Création d'un maillage MG structuré");
119 double intx, inty, intz;
120 std::vector<double> tabx,taby,tabz;
164 geo=
new MG_GEOMETRIE((
char*)
"VIRTUEL",(
char*)
"VIRTUEL");
229 std::vector<MG_NOEUD*> vecnod;
230 for (
int l=0; l<=
k ;l++)
232 for (
int j=0; j<=
m;j++)
234 for (
int i=0; i<=
n;i++)
239 if ((i==0) && (j==0) && (l==0)) topo=som1;
240 else if ((i==0) && (j==
m) && (l==0)) topo=som2;
241 else if ((i==0) && (j==
m) && (l==
k)) topo=som3;
242 else if ((i==0) && (j==0) && (l==
k)) topo=som4;
243 else if ((i==
n) && (j==0) && (l==0)) topo=som5;
244 else if ((i==
n) && (j==
m) && (l==0)) topo=som6;
245 else if ((i==
n) && (j==
m) && (l==
k)) topo=som7;
246 else if ((i==
n) && (j==0) && (l==
k)) topo=som8;
247 else if ((j==0) && (l==0)) topo=are1;
248 else if ((j==
m) && (l==0)) topo=are2;
249 else if ((j==
m) && (l==
k)) topo=are3;
250 else if ((j==0) && (l==
k)) topo=are4;
251 else if ((i==0) && (l==0)) topo=are5;
252 else if ((i==
n) && (l==0)) topo=are6;
253 else if ((i==
n) && (l==
k)) topo=are7;
254 else if ((i==0) && (l==
k)) topo=are8;
255 else if ((i==0) && (j==0)) topo=are9;
256 else if ((i==
n) && (j==0)) topo=are10;
257 else if ((i==
n) && (j==
m)) topo=are11;
258 else if ((i==0) && (j==
m)) topo=are12;
259 else if (i==0) topo=face1;
260 else if (i==
n) topo=face2;
261 else if (j==0) topo=face3;
262 else if (j==
m) topo=face4;
263 else if (l==0) topo=face5;
264 else if (l==
k) topo=face6;
281 vecnod.push_back(nou);
298 for(
int i=0; i<
n;i++)
301 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
302 MG_NOEUD* nod2=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
305 MG_NOEUD* nod3=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
306 MG_NOEUD* nod4=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
309 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
310 MG_NOEUD* nod6=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
313 MG_NOEUD* nod7=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
314 MG_NOEUD* nod8=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
317 for(
int j=0; j<
m;j++)
320 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
321 MG_NOEUD* nod2=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
324 MG_NOEUD* nod3=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
325 MG_NOEUD* nod4=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
328 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
329 MG_NOEUD* nod6=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
332 MG_NOEUD* nod7=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
333 MG_NOEUD* nod8=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
336 for(
int l=0; l<
k;l++)
339 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
340 MG_NOEUD* nod2=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
343 MG_NOEUD* nod3=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
344 MG_NOEUD* nod4=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
347 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
348 MG_NOEUD* nod6=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
351 MG_NOEUD* nod7=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
352 MG_NOEUD* nod8=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
355 for (
int j=0;j<
m;j++)
356 for (
int l=0;l<
k;l++)
359 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
360 MG_NOEUD* nod2=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
361 MG_NOEUD* nod3=vecnod[i+((
n+1)*(j+1))+((l+1)*(
m+1)*(
n+1))];
362 MG_NOEUD* nod4=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
364 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
365 MG_NOEUD* nod6=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
366 MG_NOEUD* nod7=vecnod[i+((
n+1)*(j+1))+((l+1)*(
m+1)*(
n+1))];
367 MG_NOEUD* nod8=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
371 for (
int i=0;i<
n;i++)
372 for (
int l=0;l<
k;l++)
375 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
376 MG_NOEUD* nod2=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
377 MG_NOEUD* nod3=vecnod[(i+1)+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
378 MG_NOEUD* nod4=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
380 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
381 MG_NOEUD* nod6=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
382 MG_NOEUD* nod7=vecnod[(i+1)+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
383 MG_NOEUD* nod8=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
387 for (
int i=0;i<
n;i++)
388 for (
int j=0;j<
m;j++)
391 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
392 MG_NOEUD* nod2=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
393 MG_NOEUD* nod3=vecnod[(i+1)+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
394 MG_NOEUD* nod4=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
396 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
397 MG_NOEUD* nod6=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
398 MG_NOEUD* nod7=vecnod[(i+1)+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
399 MG_NOEUD* nod8=vecnod[i+((
n+1)*(j+1))+(l*(
m+1)*(
n+1))];
404 for(
int l=0; l<
k;l++)
406 for(
int j=0; j<
m;j++)
408 for(
int i=0; i<
n;i++)
410 MG_NOEUD* nod1=vecnod[i+((
n+1)*j)+(l*(
m+1)*(
n+1))];
411 MG_NOEUD* nod2=vecnod[(i+1)+((
n+1)*j)+(l*(
m+1)*(
n+1))];
412 MG_NOEUD* nod3=vecnod[(i+1)+(
n+1)*(j+1)+(l*(
m+1)*(
n+1))];
413 MG_NOEUD* nod4=vecnod[i+(
n+1)*(j+1)+(l*(
m+1)*(
n+1))];
414 MG_NOEUD* nod5=vecnod[i+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
415 MG_NOEUD* nod6=vecnod[(i+1)+((
n+1)*j)+((l+1)*(
m+1)*(
n+1))];
416 MG_NOEUD* nod7=vecnod[(i+1)+(
n+1)*(j+1)+((l+1)*(
m+1)*(
n+1))];
417 MG_NOEUD* nod8=vecnod[i+(
n+1)*(j+1)+((l+1)*(
m+1)*(
n+1))];