MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mailleur_bloc.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// mailleur_bloc.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 #include "gestionversion.h"
24 #include <math.h>
25 #include "mailleur_bloc.h"
26 #include "mg_gestionnaire.h"
27 #include "mailleur3d.h"
28 #include "mailleur0d.h"
29 #include "mailleur1d.h"
30 #include "mailleur2d.h"
31 #include "ot_mathematique.h"
32 #include "mg_geometrie_outils.h"
33 
34 
35 
36 #pragma package(smart_init)
37 
38 
39 
40 
41 
42 MAILLEUR_BLOC::MAILLEUR_BLOC(class MG_GESTIONNAIRE* gentier,MG_GESTIONNAIRE* gbloc,int numgeoentier,int numgeobloc,class FCT_TAILLE* fct_taille,bool save):MAILLEUR(save),gestentier(gentier),gestbloc(gbloc),carte(fct_taille)
43 {
44 if (numgeoentier==0) geoentier=gestentier->get_mg_geometrie(numgeoentier);
45 else geoentier=gestentier->get_mg_geometrieid(numgeoentier);
46 if (numgeobloc==0) geobloc=gestbloc->get_mg_geometrie(numgeobloc);
47 else geobloc=gestbloc->get_mg_geometrieid(numgeobloc);
48 }
49 
51 {
52 delete octreeentier;
53 delete octreebloc;
54 /*int nbface=maientier->get_mg_geometrie()->get_nb_mg_face();
55 for (int i=0;i<nbface;i++) delete quadentier[i];
56 delete [] quadentier;
57 nbface=maibloc->get_mg_geometrie()->get_nb_mg_face();
58 for (int i=0;i<nbface;i++) delete quadbloc[i];
59 delete [] quadbloc;
60 int nbseg=lstsegfrontentier.get_nb();
61 for (int i=0;i<nbseg;i++) delete lstsegfrontentier.get(i);
62 nbseg=lstsegfrontbloc.get_nb();
63 for (int i=0;i<nbseg;i++) delete lstsegfrontbloc.get(i);*/
64 
65 }
66 
67 
69 {
70 if(maille(20)==FAIL) return FAIL;
71 return OK;
72 }
73 
74 int MAILLEUR_BLOC::maille(int etape)
75 {
80 affiche((char*)" MAILLAGE 0D du modele entier");
81 MAILLEUR0D m0d_entier(maientier,geoentier);
82 m0d_entier.maille();
83 if (etape<2) return OK;
84 int nbnoeudentier=maientier->get_nb_mg_noeud();
85 for (int i=0;i<nbnoeudentier;i++)
86  {
87  MG_NOEUD* noeud=maientier->get_mg_noeud(i);
88  double *xyz=noeud->get_coord();
90  if (som!=NULL)
91  {
92  MG_NOEUD *nvnoeud=new MG_NOEUD(som, xyz[0],xyz[1],xyz[2], MAGIC::ORIGINE::IMPOSE);
93  maibloc->ajouter_mg_noeud(nvnoeud);
94  //octreebloc->inserer(nvnoeud);
95  }
96  /* else
97  {
98  int num;
99  double t;
100  MG_ARETE* are=verif_noeud_sur_arete(xyz, geobloc, &num,&t);
101  if (are!=NULL)
102  {
103  MG_NOEUD_ADDITIONNEL_ARETE noeud_add;
104  noeud_add.noeud=noeud;
105  noeud_add.t=t;
106  std::pair<double,MG_NOEUD_ADDITIONNEL_ARETE> tmp(t,noeud_add);
107  lst_noeuds_bloc[num].insert(tmp);
108  }
109  }*/
110 
111 
112  }
113 if (etape<3) return OK;
114 affiche((char*)" MAILLAGE 0D du modele bloc");
115 int nbnoeudblocavantm0d=maibloc->get_nb_mg_noeud();
116 MAILLEUR0D m0d_bloc(maibloc,geobloc);
117 m0d_bloc.adapte();
118 if (etape<4) return OK;
119 int nbnouveaunoeudbloc=maibloc->get_nb_mg_noeud()-nbnoeudblocavantm0d;
120 int nbareteentier=geoentier->get_nb_mg_arete();
121 LISTE_NOEUD_ADD_ARETE *lst_noeuds_entier=new LISTE_NOEUD_ADD_ARETE[nbareteentier];
122 for (int i=0;i<nbnouveaunoeudbloc;i++)
123  {
124  MG_NOEUD *noeud=maibloc->get_mg_noeud(i+nbnoeudblocavantm0d);
125  double *xyz=noeud->get_coord();
126  int num;double t;
127  MG_ARETE* are=verif_noeud_sur_arete(xyz, geoentier, &num,&t);
128  if (are!=NULL)
129  {
130  MG_NOEUD_ADDITIONNEL_ARETE noeud_add;
131  noeud_add.noeud=noeud;
132  noeud_add.t=t;
133  std::pair<double,MG_NOEUD_ADDITIONNEL_ARETE > tmp(t,noeud_add);
134  lst_noeuds_entier[num].insert(tmp);
135  }
136  }
137 if (etape<5) return OK;
138 affiche((char*)" MAILLAGE 1D du modele entier");
139 for (int i=0;i<nbareteentier;i++)
140  {
142  int nbnoeudcontraint=lst_noeuds_entier[i].size();
143  MG_NOEUD* noeuddepart;
144  int numsom=are->get_cosommet1()->get_sommet()->get_lien_maillage()->get_nb();
145  for (int j=0;j<numsom;j++)
146  if (maientier->get_mg_noeudid(are->get_cosommet1()->get_sommet()->get_lien_maillage()->get(j)->get_id())!=NULL) noeuddepart=(MG_NOEUD*)are->get_cosommet1()->get_sommet()->get_lien_maillage()->get(j);
147  MG_NOEUD* noeudarrivee;
148  numsom=are->get_cosommet2()->get_sommet()->get_lien_maillage()->get_nb();
149  for (int j=0;j<numsom;j++)
150  if (maientier->get_mg_noeudid(are->get_cosommet2()->get_sommet()->get_lien_maillage()->get(j)->get_id())!=NULL) noeudarrivee=(MG_NOEUD*)are->get_cosommet2()->get_sommet()->get_lien_maillage()->get(j);
151  MG_NOEUD* navant;
152  double tavant;
153  IT_LISTE_NOEUD_ADD_ARETE it=lst_noeuds_entier[i].begin();
154  for (int j=0;j<nbnoeudcontraint+1;j++)
155  {
156  MG_NOEUD* n1,*n2;
157  double t1,t2;
158  if (j==0) {n1=noeuddepart;t1=are->get_tmin();} else {n1=navant;t1=tavant;}
159  if (j==nbnoeudcontraint) {n2=noeudarrivee;t2=are->get_tmax();}
160  else
161  {
162  double *xyz=(*it).second.noeud->get_coord();
163  n2=new MG_NOEUD(are, xyz[0],xyz[1],xyz[2], MAGIC::ORIGINE::IMPOSE);
165  t2=(*it).second.t;
166  it++;
167  }
168  MAILLEUR1D m1d(maientier, geoentier, carte,are);
170  m1d.maille(are,t1,n1,t2,n2);
171  tavant=t2;
172  navant=n2;
173  }
174  }
175 delete [] lst_noeuds_entier;
178 int nbnoeudtmp=maientier->get_nb_mg_noeud();
179 for (int i=0;i<nbnoeudtmp;i++)
181 nbnoeudtmp=maibloc->get_nb_mg_noeud();
182 for (int i=0;i<nbnoeudtmp;i++)
184 if (etape<6) return OK;
185 int nbsegment=maientier->get_nb_mg_segment();
186 for (int i=0;i<nbsegment;i++)
187  {
189  MG_NOEUD* noeud1=seg->get_noeud1();
190  MG_NOEUD* noeud2=seg->get_noeud2();
191  int dim1;
192  int dim2;
193  MG_NOEUD* n1=chercher(noeud1->get_coord(),*octreebloc);
194  MG_NOEUD* n2=chercher(noeud2->get_coord(),*octreebloc);
195  MG_ARETE* are1ref;
196  MG_FACE* face1ref;
197  MG_ARETE* are2ref;
198  MG_FACE* face2ref;
199  int num1,num2;
200  double t1,t2;
201  if (n1==NULL)
202  {
203  are1ref=verif_noeud_sur_arete(noeud1->get_coord(),geobloc,&num1,&t1);
204  if (are1ref==NULL) dim1=2; else dim1=1;
205  }
206  else
207  {
208  dim1=n1->get_lien_topologie()->get_dimension();
209  if (dim1==1) are1ref=(MG_ARETE*)n1->get_lien_topologie();
210  }
211  if (n2==NULL)
212  {
213  are2ref=verif_noeud_sur_arete(noeud2->get_coord(),geobloc,&num2,&t2);
214  if (are2ref==NULL) dim2=2; else dim2=1;
215  }
216  else
217  {
218  dim2=n2->get_lien_topologie()->get_dimension();
219  if (dim2==1) are2ref=(MG_ARETE*)n2->get_lien_topologie();
220  }
221  if ((dim1==1) || (dim2==1))
222  {
223  if (dim1>1) continue;
224  if (dim2>1) continue;
225  MG_ARETE* ref;
226  if (dim1==1) ref=are1ref; else ref=are2ref;
227  if (n1==NULL)
228  {
229  n1=new MG_NOEUD(ref,noeud1->get_coord()[0],noeud1->get_coord()[1],noeud1->get_coord()[2], MAGIC::ORIGINE::IMPOSE);
231  octreebloc->inserer(n1);
232  }
233  if (n2==NULL)
234  {
235  n2=new MG_NOEUD(ref,noeud2->get_coord()[0],noeud2->get_coord()[1],noeud2->get_coord()[2], MAGIC::ORIGINE::IMPOSE);
237  octreebloc->inserer(n2);
238  }
239  double *xyz1=n1->get_coord();
240  double *xyz2=n2->get_coord();
241  OT_VECTEUR_3D vec1(xyz1,xyz2);
242  double t;
243  ref->inverser(t,xyz1);
244  double dxyz[3];
245  ref->deriver(t,dxyz);
246  OT_VECTEUR_3D vec2(dxyz[0],dxyz[1],dxyz[2]);
247  vec1.norme();
248  vec2.norme();
249  double ps=vec1*vec2;
250  MG_SEGMENT *nvsegment;
251  if (ps>0) nvsegment=new MG_SEGMENT(ref,n1,n2,MAGIC::ORIGINE::IMPOSE);
252  else nvsegment=new MG_SEGMENT(ref,n2,n1,MAGIC::ORIGINE::IMPOSE);
253  maibloc->ajouter_mg_segment(nvsegment);
254  }
255  else if ((dim1==0) && (dim2==0))
256  {
257  MG_ARETE* ref=NULL;
258  MG_SOMMET* som1=(MG_SOMMET*)n1->get_lien_topologie();
259  MG_SOMMET* som2=(MG_SOMMET*)n2->get_lien_topologie();
260  int nb_are=geobloc->get_nb_mg_arete();
261  for ( int i=0 ; i < nb_are ; i++)
262  {
263  MG_ARETE *arete=geobloc->get_mg_arete(i);
264  if ((arete->get_cosommet1()->get_sommet()==som1) && (arete->get_cosommet2()->get_sommet()==som2)) ref=arete;
265  if ((arete->get_cosommet1()->get_sommet()==som2) && (arete->get_cosommet2()->get_sommet()==som1)) ref=arete;
266  }
267  if (ref!=NULL)
268  {
269  double *xyz1=n1->get_coord();
270  double *xyz2=n2->get_coord();
271  OT_VECTEUR_3D vec1(xyz1,xyz2);
272  double t;
273  ref->inverser(t,xyz1);
274  double dxyz[3];
275  ref->deriver(t,dxyz);
276  OT_VECTEUR_3D vec2(dxyz[0],dxyz[1],dxyz[2]);
277  vec1.norme();
278  vec2.norme();
279  double ps=vec1*vec2;
280  MG_SEGMENT *nvsegment;
281  if (ps>0) nvsegment=new MG_SEGMENT(ref,n1,n2,MAGIC::ORIGINE::IMPOSE);
282  else nvsegment=new MG_SEGMENT(ref,n2,n1,MAGIC::ORIGINE::IMPOSE);
283  maibloc->ajouter_mg_segment(nvsegment);
284  }
285  }
286  }
287 if (etape<7) return OK;
288 affiche((char*)" MAILLAGE 1D du modele bloc");
289 int nbaretebloc=geobloc->get_nb_mg_arete();
290 int nbsegmentblocavant=maibloc->get_nb_mg_segment();
291 for (int i=0;i<nbaretebloc;i++)
292  {
294  m1d_bloc.change_pas_integration(pas);
295  m1d_bloc.adapte();
296  }
297 if (etape<8) return OK;
298 int nbfaceentier=geoentier->get_nb_mg_face();
299 TPL_LISTE_ENTITE<MG_SEGMENT*> *lstsegcontraint=new TPL_LISTE_ENTITE<MG_SEGMENT*>[nbfaceentier];
300 int nbsegmentbloc=maibloc->get_nb_mg_segment();
301 for (int i=nbsegmentblocavant;i<nbsegmentbloc;i++)
302  {
304  int num;
305  MG_FACE* face=seg_sur_face(seg,geoentier,&num);
306  if (face!=NULL)
307  lstsegcontraint[num].ajouter(seg);
308  /*MG_NOEUD* noeud1=seg->get_noeud1();
309  MG_NOEUD* noeud2=seg->get_noeud2();
310  int dim1;
311  int dim2;
312  MG_NOEUD* n1=chercher(noeud1->get_coord(),*octreeentier);
313  MG_NOEUD* n2=chercher(noeud2->get_coord(),*octreeentier);
314  MG_FACE* face1ref;
315  MG_FACE* face2ref;
316  int num1,num2;
317  if (n1==NULL)
318  {
319  face1ref=verif_noeud_sur_face(noeud1->get_coord(),geoentier,&num1,octreeentierseg);
320  if (face1ref==NULL) dim1=3; else dim1=2;
321  }
322  else
323  dim1=n1->get_lien_topologie()->get_dimension();
324  if (n2==NULL)
325  {
326  face2ref=verif_noeud_sur_face(noeud2->get_coord(),geoentier,&num2,octreeentierseg);
327  if (face2ref==NULL) dim2=3; else dim2=2;
328  }
329  else
330  dim2=n2->get_lien_topologie()->get_dimension();
331  if ((dim1==3) || (dim2==3)) continue;
332  if ((dim1==2) || (dim2==2))
333  {
334  int num;
335  if (dim1==2) num=num1;
336  else if (dim2==2) num=num2;
337  lstsegcontraint[num].ajouter(seg);
338  } */
339  }
340 if (etape<9) return OK;
341 affiche((char*)" MAILLAGE 2D du modele entier");
342 for (int i=0;i<nbfaceentier;i++)
343  {
344  MG_FACE* face=geoentier->get_mg_face(i);
346  char mess[50];
348  sprintf(mess," Face %i identificateur %lu",i,face->get_id());
349  affiche(mess);
350  m2d.maille(face,&(lstsegcontraint[i]));
351  }
352 delete [] lstsegcontraint;
353 if (etape<10) return OK;
354 int nbfacebloc=geobloc->get_nb_mg_face();
355 TPL_LISTE_ENTITE<MG_TRIANGLE*> *lsttricontraint=new TPL_LISTE_ENTITE<MG_TRIANGLE*>[nbfacebloc];
356 int nbtrientier=maientier->get_nb_mg_triangle();
357 for (int i=0;i<nbtrientier;i++)
358  {
360  int num;
361  MG_FACE* face=tri_sur_face(tri,geobloc,&num);
362  if (face!=NULL)
363  lsttricontraint[num].ajouter(tri);
364  }
365 if (etape<11) return OK;
366 affiche((char*)" MAILLAGE 2D du modele bloc");
367 for (int i=0;i<nbfacebloc;i++)
368  {
369  MG_FACE* face=geobloc->get_mg_face(i);
370  MAILLEUR2D m2d(maibloc,geobloc,carte,face);
371  char mess[50];
373  sprintf(mess," Face %i identificateur %lu",i,face->get_id());
374  affiche(mess);
375  m2d.maille(face,NULL,&(lsttricontraint[i]));
376  }
377 delete [] lsttricontraint;
378 if (etape<12) return OK;
379 affiche((char*)" MAILLAGE 3D du modele bloc");
380 int nbvolumebloc=geobloc->get_nb_mg_volume();
381 for (int i=0;i<nbvolumebloc;i++)
382 {
384  MAILLEUR3D m3d(maibloc,geobloc,carte,false,vol);
387  m3d.maille(vol);
388 }
389 if (etape<13) return OK;
391 LISTE_MG_TETRA::iterator it;
392 for (MG_TETRA* tet=maibloc->get_premier_tetra(it);tet!=NULL;tet=maibloc->get_suivant_tetra(it))
393  lsttetra.ajouter(tet);
394 if (etape<14) return OK;
395 affiche((char*)" MAILLAGE 3D du modele entier");
401  m3d.maille(vol,NULL,&lsttetra);
402 return OK;
403 }
404 
406 {
408 octree.rechercher(xyz[0],xyz[1],xyz[2],1e-5,lst);
409 int nb=lst.get_nb();
410 for (int i=0;i<nb;i++)
411  {
412  OT_VECTEUR_3D vec(xyz,lst.get(i)->get_coord());
413  double metrique[9];
414  carte->evaluer(xyz,metrique);
415  double eps=(1./sqrt(metrique[0])*1e-10);
416  if (vec.get_longueur()<eps) return lst.get(i);
417  }
418 return NULL;
419 }
420 
421 
423 {
424  int nbsom=geo->get_nb_mg_sommet();
425  for (int i=0;i<nbsom;i++)
426  {
427  MG_SOMMET *sommet=geo->get_mg_sommet(i);
428  double xyzsom[3];
429  sommet->get_point()->evaluer(xyzsom);
430  double metrique[9];
431  carte->evaluer(xyz,metrique);
432  double eps=(1./sqrt(metrique[0])*1e-6);
433  OT_VECTEUR_3D vec(xyz,xyzsom);
434  if (vec.get_longueur()<eps) return sommet;
435  }
436 return NULL;
437 }
438 
439 
440 MG_ARETE* MAILLEUR_BLOC::verif_noeud_sur_arete(double *xyz, MG_GEOMETRIE *geo,int *num, double *t)
441 {
442  int nb_are=geo->get_nb_mg_arete();
443  for ( int i=0 ; i < nb_are ; i++)
444  {
445  MG_ARETE *arete=geo->get_mg_arete(i);
446  arete->inverser((*t),xyz);
447  if (arete->get_courbe()->est_periodique())
448  if (*t< arete->get_tmin()) *t=*t+arete->get_courbe()->get_periode();
449  double xyztmp[3];
450  arete->evaluer( *t,xyztmp );
451  double metrique[9];
452  carte->evaluer(xyz,metrique);
453  double eps=(1./sqrt(metrique[0])*1e-6);
454  OT_VECTEUR_3D vec(xyz,xyztmp);
455  if (vec.get_longueur()<eps)
456  if ((*t>arete->get_tmin()) && (*t<arete->get_tmax()))
457  {
458  *num=i;
459  return arete;
460  }
461  }
462  return NULL;
463 }
464 
466 {
467 double *xyz1=seg->get_noeud1()->get_coord();
468 double *xyz2=seg->get_noeud2()->get_coord();
469 int nbface=geo->get_nb_mg_face();
470 for (int i=0;i<nbface;i++)
471  {
472  MG_FACE *face=geo->get_mg_face(i);
473  double metrique[9];
474  carte->evaluer(xyz1,metrique);
475  double eps=(1./sqrt(metrique[0])*1e-6);
476  double uv1[2],xyz1bis[3];
477  face->inverser(uv1,xyz1);
478  face->evaluer(uv1,xyz1bis);
479  OT_VECTEUR_3D vec1(xyz1,xyz1bis);
480  if (vec1.get_longueur()<eps)
481  {
482  double uv2[2],xyz2bis[3];
483  face->inverser(uv2,xyz2);
484  face->evaluer(uv2,xyz2bis);
485  OT_VECTEUR_3D vec2(xyz2,xyz2bis);
486  if (vec2.get_longueur()<eps)
487  {
488  double xyz[3];
489  xyz[0]=0.5*(xyz1[0]+xyz2[0]);
490  xyz[1]=0.5*(xyz1[1]+xyz2[1]);
491  xyz[2]=0.5*(xyz1[2]+xyz2[2]);
492  double uv[2];
493  face->inverser(uv,xyz);
494  double dist=otentier.calcule_distance_contour_face_uv(uv,face);
495  if (dist>0.) {*num=i;return face;}
496  }
497  }
498  }
499 return NULL;
500 }
501 
503 {
504 double *xyz1=tri->get_noeud1()->get_coord();
505 double *xyz2=tri->get_noeud2()->get_coord();
506 double *xyz3=tri->get_noeud3()->get_coord();
507 int nbface=geo->get_nb_mg_face();
508 for (int i=0;i<nbface;i++)
509  {
510  MG_FACE *face=geo->get_mg_face(i);
511  double metrique[9];
512  carte->evaluer(xyz1,metrique);
513  double eps=(1./sqrt(metrique[0])*1e-6);
514  double uv1[2],xyz1bis[3];
515  face->inverser(uv1,xyz1);
516  face->evaluer(uv1,xyz1bis);
517  OT_VECTEUR_3D vec1(xyz1,xyz1bis);
518  if (vec1.get_longueur()<eps)
519  {
520  double uv2[2],xyz2bis[3];
521  face->inverser(uv2,xyz2);
522  face->evaluer(uv2,xyz2bis);
523  OT_VECTEUR_3D vec2(xyz2,xyz2bis);
524  if (vec2.get_longueur()<eps)
525  {
526  double uv3[2],xyz3bis[3];
527  face->inverser(uv3,xyz3);
528  face->evaluer(uv3,xyz3bis);
529  OT_VECTEUR_3D vec3(xyz3,xyz3bis);
530  if (vec3.get_longueur()<eps)
531  {
532  double xyz[3];
533  double uv[2];
535  double du=deca.calcul_decalage_parametre_u(uv1[0]);
536  double dv=deca.calcul_decalage_parametre_v(uv1[1]);
537 
538  uv[0]=0.333333333333333333*(deca.decalage_parametre_u(uv1[0],du)+deca.decalage_parametre_u(uv2[0],du)+deca.decalage_parametre_u(uv3[0],du));
539  uv[1]=0.333333333333333333*(deca.decalage_parametre_v(uv1[1],dv)+deca.decalage_parametre_v(uv2[1],dv)+deca.decalage_parametre_v(uv3[1],dv));
540  uv[0]=deca.decalage_parametre_u(uv[0],-du);
541  uv[1]=deca.decalage_parametre_v(uv[1],-dv);
542  double dist=otbloc.calcule_distance_contour_face_uv(uv,face);
543  if (dist>0.) {*num=i;return face;}
544  }
545  }
546  }
547  }
548 return NULL;
549 }
550 
551 
553 {
554 double xmin=1e300,ymin=1e300,zmin=1e300;
555 double xmax=-1e300,ymax=-1e300,zmax=-1e300;
557 int nb_noeud=mai->get_nb_mg_noeud();
558 for (int i=0;i<nb_noeud;i++)
559  {
560  MG_NOEUD* mgnoeud=mai->get_mg_noeud(i);
561  lstnoeud.ajouter(mgnoeud);
562  xmin=std::min(xmin,mgnoeud->get_x());
563  ymin=std::min(ymin,mgnoeud->get_y());
564  zmin=std::min(zmin,mgnoeud->get_z());
565  xmax=std::max(xmax,mgnoeud->get_x());
566  ymax=std::max(ymax,mgnoeud->get_y());
567  zmax=std::max(zmax,mgnoeud->get_z());
568  }
569 double xdiff=xmax-xmin;
570 double ydiff=ymax-ymin;
571 double zdiff=zmax-zmin;
572 xmin=xmin-0.125*xdiff;
573 xmax=xmax+0.125*xdiff;
574 ymin=ymin-0.125*ydiff;
575 ymax=ymax+0.125*ydiff;
576 zmin=zmin-0.125*zdiff;
577 zmax=zmax+0.125*zdiff;
578 (*octree)=new TPL_OCTREE<MG_NOEUD*,MG_NOEUD*>;
579 (*octree)->initialiser(&lstnoeud,1,xmin,ymin,zmin,xmax,ymax,zmax);
580 }
581 
583 {
584 (*octree2)=new TPL_OCTREE<MG_NOEUD*,MG_NOEUD*>;
585 (*octree2)->initialiser(octree1);
586 }
587 
588 
589 
590 
MAILLEUR::savedbg
bool savedbg
Definition: mailleur.h:53
MG_ARETE::get_cosommet2
virtual class MG_COSOMMET * get_cosommet2(void)
Definition: mg_arete.cpp:85
MG_COURBE::est_periodique
virtual int est_periodique(void)=0
MG_SEGMENT
Definition: mg_segment.h:38
MG_NOEUD_ADDITIONNEL_ARETE::noeud
class MG_NOEUD * noeud
Definition: mailleur_bloc.h:77
gestionversion.h
MAGIC_AFFICHE::active_affichage
virtual void active_affichage(fonction_affiche *fonc)
Definition: magic_affiche.cpp:49
MG_SURFACE::get_periode_u
virtual double get_periode_u(void)=0
MG_MAILLAGE::ajouter_mg_segment
MG_SEGMENT * ajouter_mg_segment(MG_ELEMENT_TOPOLOGIQUE *topo, class MG_NOEUD *mgnoeud1, class MG_NOEUD *mgnoeud2, int origine, double longue=0.0, unsigned long num=0)
Definition: mg_maillage.cpp:565
TPL_MAP_ENTITE< MG_NOEUD * >
FAIL
const int FAIL
Definition: mg_definition.h:39
MG_ARETE::evaluer
virtual void evaluer(double t, double *xyz)
Definition: mg_arete.cpp:143
mg_gestionnaire.h
MG_NOEUD_ADDITIONNEL_ARETE
Definition: mailleur_bloc.h:74
MG_SEGMENT::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_segment.cpp:113
mailleur2d.h
MG_NOEUD::get_z
virtual double get_z(void)
Definition: mg_noeud.cpp:87
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
MG_MAILLAGE::get_nb_mg_triangle
unsigned int get_nb_mg_triangle(void)
Definition: mg_maillage.cpp:814
MAILLEUR_BLOC::chercher
class MG_NOEUD * chercher(double *xyz, TPL_OCTREE< MG_NOEUD *, MG_NOEUD * > &octree)
Definition: mailleur_bloc.cpp:405
MG_GEOMETRIE::get_nb_mg_arete
unsigned int get_nb_mg_arete(void)
Definition: mg_geometrie.cpp:813
MG_MAILLAGE::get_premier_tetra
MG_TETRA * get_premier_tetra(LISTE_MG_TETRA::iterator &it)
Definition: mg_maillage.cpp:1374
MAILLEUR_BLOC::gestbloc
class MG_GESTIONNAIRE * gestbloc
Definition: mailleur_bloc.h:61
MAILLEUR_BLOC::maientier
class MG_MAILLAGE * maientier
Definition: mailleur_bloc.h:64
MAILLEUR_BLOC::otentier
MG_GEOMETRIE_OUTILS otentier
Definition: mailleur_bloc.h:68
MAILLEUR3D::maille
virtual int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur3d.cpp:55
MG_ELEMENT_TOPOLOGIQUE::get_dimension
virtual int get_dimension(void)=0
MAGIC_AFFICHE::affiche
virtual void affiche(char *mess)
Definition: magic_affiche.cpp:43
MG_GEOMETRIE::get_mg_sommet
MG_SOMMET * get_mg_sommet(unsigned int num)
Definition: mg_geometrie.cpp:539
OK
const int OK
Definition: mg_definition.h:38
MG_TRIANGLE
Definition: mg_triangle.h:38
FCT_TAILLE
Definition: fct_taille.h:30
MG_VOLUME
Definition: mg_volume.h:33
MG_GESTIONNAIRE
Definition: mg_gestionnaire.h:57
MAILLEUR3D
Definition: mailleur3d.h:51
MAILLEUR::pas
int pas
Definition: mailleur.h:56
MG_TETRA
Definition: mg_tetra.h:37
MAILLEUR2D
Definition: mailleur2d.h:49
MAILLEUR1D
Definition: mailleur1d.h:36
MAGIC_AFFICHE::affiche2
fonction_affiche * affiche2
Definition: magic_affiche.h:41
MAILLEUR_BLOC::octreebloc
class TPL_OCTREE< class MG_NOEUD *, class MG_NOEUD * > * octreebloc
Definition: mailleur_bloc.h:65
MAILLEUR0D
Definition: mailleur0d.h:34
MG_ARETE::get_tmin
virtual double get_tmin(void)
Definition: mg_arete.cpp:179
MG_ELEMENT_TOPOLOGIQUE::get_lien_maillage
virtual TPL_SET< MG_ELEMENT_MAILLAGE * > * get_lien_maillage(void)
Definition: mg_element_topologique.cpp:62
MG_MAILLAGE::get_suivant_tetra
MG_TETRA * get_suivant_tetra(LISTE_MG_TETRA::iterator &it)
Definition: mg_maillage.cpp:1382
MG_FACE::inverser
virtual void inverser(double *uv, double *xyz, double precision=1e-6)
Definition: mg_face.cpp:228
MG_ARETE::inverser
virtual void inverser(double &t, double *xyz, double precision=1e-6)
Definition: mg_arete.cpp:173
MAILLEUR_BLOC::verif_noeud_sur_sommet
class MG_SOMMET * verif_noeud_sur_sommet(double *xyz, class MG_GEOMETRIE *geo)
Definition: mailleur_bloc.cpp:422
TPL_OCTREE::inserer
virtual void inserer(BOITE_3D &boite, A a, TPL_CELLULE_OCTREE< A, CONDITION > *cellule)
Definition: tpl_octree.h:897
MAILLEUR::change_nom_fichierdbg
virtual void change_nom_fichierdbg(char *nom)
Definition: mailleur.cpp:66
MAILLEUR_BLOC::gestentier
class MG_GESTIONNAIRE * gestentier
Definition: mailleur_bloc.h:61
MG_MAILLAGE::get_mg_noeud
MG_NOEUD * get_mg_noeud(unsigned int num)
Definition: mg_maillage.cpp:463
MG_GESTIONNAIRE::ajouter_mg_maillage
int ajouter_mg_maillage(MG_MAILLAGE *mgmai)
Definition: mg_gestionnaire.cpp:521
MAILLEUR_BLOC::~MAILLEUR_BLOC
~MAILLEUR_BLOC()
Definition: mailleur_bloc.cpp:50
MG_FACE::evaluer
virtual void evaluer(double *uv, double *xyz)
Definition: mg_face.cpp:192
MG_SEGMENT::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_segment.cpp:108
MAILLEUR_BLOC::carte
class FCT_TAILLE * carte
Definition: mailleur_bloc.h:63
mailleur_bloc.h
TPL_MAP_ENTITE::get_nb
virtual int get_nb(void)
Definition: tpl_map_entite.h:83
MG_NOEUD
Definition: mg_noeud.h:41
TPL_SET::get_nb
int get_nb(void)
Definition: tpl_set.h:78
MG_GEOMETRIE::get_mg_arete
MG_ARETE * get_mg_arete(unsigned int num)
Definition: mg_geometrie.cpp:800
MAGIC::ORIGINE::IMPOSE
@ IMPOSE
Definition: mg_definition.h:79
MAILLEUR_BLOC::geoentier
class MG_GEOMETRIE * geoentier
Definition: mailleur_bloc.h:62
TPL_OCTREE::rechercher
virtual void rechercher(BOITE_3D &boite, TPL_MAP_ENTITE< A > &liste_entite_trouve, TPL_CELLULE_OCTREE< A, CONDITION > *cellule)
Definition: tpl_octree.h:606
MAILLEUR_BLOC::geobloc
class MG_GEOMETRIE * geobloc
Definition: mailleur_bloc.h:62
mailleur1d.h
TPL_LISTE_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_liste_entite.h:38
MG_NOEUD::get_coord
virtual double * get_coord(void)
Definition: mg_noeud.cpp:92
IT_LISTE_NOEUD_ADD_ARETE
std::map< double, MG_NOEUD_ADDITIONNEL_ARETE, std::less< double > >::iterator IT_LISTE_NOEUD_ADD_ARETE
Definition: mailleur_bloc.h:84
MAILLEUR_BLOC::otbloc
MG_GEOMETRIE_OUTILS otbloc
Definition: mailleur_bloc.h:69
MAILLEUR::change_pas_integration
void change_pas_integration(int val)
Definition: mailleur.cpp:92
MG_SOMMET::get_point
virtual MG_POINT * get_point(void)
Definition: mg_sommet.cpp:52
LISTE_NOEUD_ADD_ARETE
std::map< double, MG_NOEUD_ADDITIONNEL_ARETE, std::less< double > > LISTE_NOEUD_ADD_ARETE
Definition: mailleur_bloc.h:83
MAILLEUR1D::adapte
void adapte(void)
Definition: mailleur1d.cpp:244
OT_VECTEUR_3D::norme
virtual void norme(void)
Definition: ot_mathematique.cpp:494
MG_NOEUD_ADDITIONNEL_ARETE::t
double t
Definition: mailleur_bloc.h:78
MG_MAILLAGE::get_nb_mg_segment
unsigned int get_nb_mg_segment(void)
Definition: mg_maillage.cpp:646
MG_TRIANGLE::get_noeud2
virtual MG_NOEUD * get_noeud2(void)
Definition: mg_triangle.cpp:131
MG_GEOMETRIE::get_mg_face
MG_FACE * get_mg_face(unsigned int num)
Definition: mg_geometrie.cpp:1251
MG_COSOMMET::get_sommet
virtual MG_SOMMET * get_sommet(void)
Definition: mg_cosommet.cpp:83
MG_GEOMETRIE_OUTILS::calcule_distance_contour_face_uv
double calcule_distance_contour_face_uv(double *uv, class MG_FACE *face)
Definition: mg_geometrie_outils.cpp:110
ot_mathematique.h
OT_DECALAGE_PARAMETRE::decalage_parametre_u
double decalage_parametre_u(double par, double dpar)
Definition: ot_decalage_parametre.cpp:51
MG_MAILLAGE::get_mg_noeudid
MG_NOEUD * get_mg_noeudid(unsigned long num)
Definition: mg_maillage.cpp:451
MG_GEOMETRIE::get_nb_mg_face
unsigned int get_nb_mg_face(void)
Definition: mg_geometrie.cpp:1264
MAILLEUR_BLOC::maille
int maille(int etape)
Definition: mailleur_bloc.cpp:74
MG_NOEUD::get_x
virtual double get_x(void)
Definition: mg_noeud.cpp:77
MG_MAILLAGE::get_mg_segment
MG_SEGMENT * get_mg_segment(unsigned int num)
Definition: mg_maillage.cpp:619
OT_VECTEUR_3D
Definition: ot_mathematique.h:94
TPL_MAP_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_map_entite.h:55
MG_GEOMETRIE::get_nb_mg_volume
unsigned int get_nb_mg_volume(void)
Definition: mg_geometrie.cpp:1712
TPL_SET::get
X get(int num)
Definition: tpl_set.h:84
MG_TRIANGLE::get_noeud1
virtual MG_NOEUD * get_noeud1(void)
Definition: mg_triangle.cpp:126
MG_MAILLAGE::get_mg_triangle
MG_TRIANGLE * get_mg_triangle(unsigned int num)
Definition: mg_maillage.cpp:784
mailleur3d.h
sqrt
double2 sqrt(double2 &val)
Definition: ot_doubleprecision.cpp:345
MAILLEUR1D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur1d.cpp:50
MAILLEUR_BLOC::MAILLEUR_BLOC
MAILLEUR_BLOC(class MG_GESTIONNAIRE *gentier, MG_GESTIONNAIRE *gbloc, int numgeoentier, int numgeobloc, class FCT_TAILLE *fct_taille, bool save)
Definition: mailleur_bloc.cpp:42
OT_DECALAGE_PARAMETRE::calcul_decalage_parametre_v
double calcul_decalage_parametre_v(double par)
Definition: ot_decalage_parametre.cpp:43
MAGIC::MAILLEURFRONTALETAT::LIMITEDETRUIRE
@ LIMITEDETRUIRE
Definition: mg_definition.h:114
MAGIC_AFFICHE::affichageactif
int affichageactif
Definition: magic_affiche.h:42
MG_GROUPE_TOPOLOGIQUE
Definition: mg_groupe_topologique.h:31
MG_SURFACE::get_periode_v
virtual double get_periode_v(void)=0
MAILLEUR_BLOC::cree_octree
void cree_octree(class MG_MAILLAGE *mai, TPL_OCTREE< class MG_NOEUD *, MG_NOEUD * > **octree)
Definition: mailleur_bloc.cpp:552
MAILLEUR2D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur2d.cpp:49
MG_ARETE::get_courbe
virtual class MG_COURBE * get_courbe(void)
Definition: mg_arete.cpp:89
MG_ELEMENT_MAILLAGE::get_lien_topologie
MG_ELEMENT_TOPOLOGIQUE * get_lien_topologie(void)
Definition: mg_element_maillage.cpp:51
TPL_MAP_ENTITE::get
virtual X get(int num)
Definition: tpl_map_entite.h:89
mg_geometrie_outils.h
MG_TRIANGLE::get_noeud3
virtual MG_NOEUD * get_noeud3(void)
Definition: mg_triangle.cpp:137
MG_MAILLAGE::get_nb_mg_noeud
unsigned int get_nb_mg_noeud(void)
Definition: mg_maillage.cpp:476
OT_DECALAGE_PARAMETRE::calcul_decalage_parametre_u
double calcul_decalage_parametre_u(double par)
Definition: ot_decalage_parametre.cpp:35
MAILLEUR
Definition: mailleur.h:33
MG_GEOMETRIE
Definition: mg_geometrie.h:84
OT_VECTEUR_3D::get_longueur
virtual double get_longueur(void) const
Definition: ot_mathematique.cpp:483
MG_COURBE::get_periode
virtual double get_periode(void)=0
MG_MAILLAGE
Definition: mg_maillage.h:62
TPL_LISTE_ENTITE< MG_SEGMENT * >
OT_DECALAGE_PARAMETRE::decalage_parametre_v
double decalage_parametre_v(double par, double dpar)
Definition: ot_decalage_parametre.cpp:75
MAILLEUR0D::adapte
void adapte(void)
Definition: mailleur0d.cpp:85
MAILLEUR_BLOC::verif_noeud_sur_arete
class MG_ARETE * verif_noeud_sur_arete(double *xyz, MG_GEOMETRIE *geo, int *num, double *t)
Definition: mailleur_bloc.cpp:440
MG_ARETE::deriver
virtual void deriver(double t, double *xyz)
Definition: mg_arete.cpp:149
MG_ARETE
Definition: mg_arete.h:36
MG_FACE
Definition: mg_face.h:34
MG_ARETE::get_cosommet1
virtual class MG_COSOMMET * get_cosommet1(void)
Definition: mg_arete.cpp:81
MG_SOMMET
Definition: mg_sommet.h:35
MAILLEUR::nomfichierdbg
char nomfichierdbg[500]
Definition: mailleur.h:54
MG_GESTIONNAIRE::get_mg_geometrie
MG_GEOMETRIE * get_mg_geometrie(unsigned int num)
Definition: mg_gestionnaire.cpp:331
MAILLEUR_BLOC::tri_sur_face
MG_FACE * tri_sur_face(class MG_TRIANGLE *tri, MG_GEOMETRIE *geo, int *num)
Definition: mailleur_bloc.cpp:502
TPL_OCTREE::initialiser
virtual void initialiser(TPL_LISTE_ENTITE< CONDITION > *lst_entite, int nombre, double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Definition: tpl_octree.h:366
OT_DECALAGE_PARAMETRE
Definition: ot_decalage_parametre.h:28
MAILLEUR_BLOC::octreeentier
class TPL_OCTREE< class MG_NOEUD *, class MG_NOEUD * > * octreeentier
Definition: mailleur_bloc.h:66
TPL_OCTREE< MG_NOEUD *, MG_NOEUD * >
MG_ARETE::get_tmax
virtual double get_tmax(void)
Definition: mg_arete.cpp:184
MG_GESTIONNAIRE::get_mg_geometrieid
MG_GEOMETRIE * get_mg_geometrieid(unsigned long num)
Definition: mg_gestionnaire.cpp:319
MG_GEOMETRIE::get_mg_volume
MG_VOLUME * get_mg_volume(unsigned int num)
Definition: mg_geometrie.cpp:1683
MAILLEUR_BLOC::seg_sur_face
class MG_FACE * seg_sur_face(class MG_SEGMENT *seg, MG_GEOMETRIE *geo, int *num)
Definition: mailleur_bloc.cpp:465
MAILLEUR_BLOC::maibloc
class MG_MAILLAGE * maibloc
Definition: mailleur_bloc.h:64
MAILLEUR0D::maille
int maille(MG_GROUPE_TOPOLOGIQUE *mggt=NULL)
Definition: mailleur0d.cpp:43
MG_POINT::evaluer
virtual void evaluer(double *xyz)=0
MG_FACE::get_surface
virtual MG_SURFACE * get_surface(void)
Definition: mg_face.cpp:109
FCT_TAILLE::evaluer
virtual void evaluer(double *param, double *resultat)=0
mailleur0d.h
MG_GEOMETRIE::get_nb_mg_sommet
unsigned int get_nb_mg_sommet(void)
Definition: mg_geometrie.cpp:552
MG_NOEUD::get_y
virtual double get_y(void)
Definition: mg_noeud.cpp:82
MG_MAILLAGE::ajouter_mg_noeud
MG_NOEUD * ajouter_mg_noeud(MG_ELEMENT_TOPOLOGIQUE *topo, double xx, double yy, double zz, int origine, unsigned long num=0)
Definition: mg_maillage.cpp:421