45 MAILLEUR2D_STRUCTURE::MAILLEUR2D_STRUCTURE(
double xmintmp,
double xmaxtmp,
double ymintmp,
double ymaxtmp,
int ntmp,
int mtmp,
MG_GESTIONNAIRE* gesttmp,
int avecgeo,
double unit):
MAILLEUR(false),xmin(xmintmp),xmax(xmaxtmp),ymin(ymintmp),ymax(ymaxtmp),n(ntmp),
m(mtmp),gest(gesttmp),geovirtuel(avecgeo),densitevariable(false),unite(unit),nbfonction(0)
48 MAILLEUR2D_STRUCTURE::MAILLEUR2D_STRUCTURE(
double xmintmp,
double xmaxtmp,
double ymintmp,
double ymaxtmp,
double (*fx)(
double),
double (*fy)(
double),
MG_GESTIONNAIRE* gesttmp,
int avecgeo,
double unit):
MAILLEUR(false),xmin(xmintmp),xmax(xmaxtmp),ymin(ymintmp),ymax(ymaxtmp),gest(gesttmp),geovirtuel(avecgeo),enx(fx),eny(fy),densitevariable(true),unite(unit),nbfonction(0)
53 xmin(mdd.xmin),xmax(mdd.xmax),ymin(mdd.ymin),ymax(mdd.ymax),n(mdd.n),
m(mdd.
m),gest(mdd.gest),nbfonction(mdd.nbfonction)
66 std::vector<integrale> tab_integrale;
68 double longueur_metrique=0.;
76 t=0.7886751345*ti+0.2113248654*tii;
77 double facteur1=(max-min)/(*en)(t);
78 t=0.7886751345*tii+0.2113248654*ti;
79 double facteur2=(max-min)/(*en)(t);
80 longueur_metrique=longueur_metrique+0.5*(tii-ti)*(facteur1+facteur2);
83 pas.li=longueur_metrique;
84 tab_integrale.insert(tab_integrale.end(),
pas);
87 nb=(int)floor(longueur_metrique);
88 if (longueur_metrique-floor(longueur_metrique)>0.5) nb++;
90 double valeur_cible=longueur_metrique/nb;
93 int nb_pas_integrale=tab_integrale.size();
94 for (
int i=0;i<nb_pas_integrale;i++)
96 while ((tab_integrale[i].li>(nbcree+1)*valeur_cible) && (nbcree<nb-1))
98 double ti=tab_integrale[i].ti;
101 if (i!=0) li=tab_integrale[i-1].li;
102 double lii=tab_integrale[i].li;
103 if (i!=nb_pas_integrale-1) tii=tab_integrale[i+1].ti;
104 t=ti+(tii-ti)/(lii-li)*((nbcree+1)*valeur_cible-li);
105 double x=min+t*(max-min);
120 affiche((
char*)
"Création d'un maillage MG structuré");
122 std::vector<double> tabx,taby;
146 geo=
new MG_GEOMETRIE((
char*)
"VIRTUEL",(
char*)
"VIRTUEL");
175 std::vector<MG_NOEUD*> vecnod;
176 for (
int j=0; j<=
m;j++)
178 for (
int i=0; i<=
n;i++)
183 if ((i==0) && (j==0)) topo=som1;
184 else if ((i==0) && (j==
m)) topo=som2;
185 else if ((i==0) && (j==
m)) topo=som3;
186 else if ((i==0) && (j==0)) topo=som4;
187 else if (j==0) topo=are1;
188 else if (i==
n) topo=are2;
189 else if (j==
m) topo=are3;
190 else if (j==0) topo=are4;
205 vecnod.push_back(nou);
217 for(
int i=0; i<
n;i++)
228 for(
int j=0; j<
m;j++)
240 for (
int i=0;i<
n;i++)
241 for (
int j=0;j<
m;j++)
245 MG_NOEUD* nod3=vecnod[(i+1)+((
n+1)*(j+1))];
262 LISTE_MG_NOEUD::iterator it;
263 double xmin=1e300,
ymin=1e300,zmin=1e300;
264 double xmax=-1e300,
ymax=-1e300,zmax=-1e300;
268 if (no->get_x()<
xmin)
xmin=no->get_x();
269 if (no->get_y()<
ymin)
ymin=no->get_y();
270 if (no->get_z()<zmin) zmin=no->get_z();
271 if (no->get_x()>
xmax)
xmax=no->get_x();
272 if (no->get_y()>
ymax)
ymax=no->get_y();
273 if (no->get_z()>zmax) zmax=no->get_z();
280 LISTE_MG_TRIANGLE::iterator itt;
286 double x=no->get_x();
287 double y=no->get_y();
288 double z=no->get_z();
298 if (val>0) trouve=
true;
300 if (trouve) no->change_nouveau_numero(1);
else no->change_nouveau_numero(0);
302 LISTE_MG_QUADRANGLE::iterator itq;
303 std::vector<unsigned long> listeasupprimer;
312 listeasupprimer.push_back(quad->get_id());
314 for (
int i=0;i<listeasupprimer.size();i++)