30 double dg_eps_particule,
32 int nb_cellule_direction,
93 if(map_sommet_volume2.
existe(sommet))
return true;
102 sprintf(message,
"Creation des TPL_GRILLE");
affiche(message);
104 LISTE_FEM_ELEMENT3::iterator it_ele3;
117 boite3d_microstructure=boite3d_microstructure+volume_matrice->
get_boite_3D();
124 std::stack<ELE_TOPO_GRILLE*> stack_ele_topo_grille;
125 LISTE_MG_FACE::iterator it_face;
129 grille_ele_topo.
inserer(ele_topo_grille);
130 stack_ele_topo_grille.push(ele_topo_grille);
132 LISTE_MG_ARETE::iterator it_arete;
136 grille_ele_topo.
inserer(ele_topo_grille);
137 stack_ele_topo_grille.push(ele_topo_grille);
139 LISTE_MG_SOMMET::iterator it_sommet;
143 grille_ele_topo.
inserer(ele_topo_grille);
144 stack_ele_topo_grille.push(ele_topo_grille);
146 sprintf(message,
"Echantionnage : Topo - Topo");
affiche(message);
147 double nb_ele_topo_grille=stack_ele_topo_grille.size();
148 while(!stack_ele_topo_grille.empty())
150 sprintf(message,
"\033[1A\033[KEchantionnage : Topo - Topo [%.2lf%%]",((nb_ele_topo_grille-stack_ele_topo_grille.size())/nb_ele_topo_grille)*100.0);
affiche(message);
151 ELE_TOPO_GRILLE* ele_topo_grille=stack_ele_topo_grille.top(); stack_ele_topo_grille.pop();
159 grille_ele_topo.
rechercher(boite_recherche,tpl_map_topo_grille_trouve);
161 for(
ELE_TOPO_GRILLE* ele_topo_grille_trouve=tpl_map_topo_grille_trouve.
get_premier(it_trouve);ele_topo_grille_trouve!=NULL;ele_topo_grille_trouve=tpl_map_topo_grille_trouve.
get_suivant(it_trouve))
163 if(ele_topo_grille==ele_topo_grille_trouve)
continue;
171 grille_ele_topo.
supprimer(ele_topo_grille);
172 delete ele_topo_grille;
174 sprintf(message,
"\033[1A\033[KEchantionnage : Topo - Topo [%.2lf%%]",((nb_ele_topo_grille-stack_ele_topo_grille.size())/nb_ele_topo_grille)*100.0);
affiche(message);
177 sprintf(message,
"Echantionnage : Courbure");
affiche(message);
180 LISTE_MG_VOLUME::iterator it_volume;
185 sprintf(message,
"\033[1A\033[KEchantionnage : Courbure [%.2lf%%]",100.0*i_volume/nb_volume);
affiche(message);
203 sprintf(message,
"\033[1A\033[KEchantionnage : Courbure [%.2lf%%]",100.0*i_volume/nb_volume);
affiche(message);
205 sprintf(message,
"Lissage de la solution");
affiche(message);
207 sprintf(message,
"Extrapolation aux noeuds");
affiche(message);
210 LISTE_FEM_NOEUD::iterator it;
213 double ecartt=nod->get_solution(0);
233 if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE)
237 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE)
241 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE)
245 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE)
249 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::FACE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET)
253 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE)
257 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE)
261 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::ARETE && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET)
265 else if(eletopo1->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET && eletopo2->
get_type()==MG_ELEMENT_TOPOLOGIQUE::TYPE_ELEMENT_TOPOLOGIQUE::SOMMET)
278 double umin,umax,vmin,vmax;
290 double pas_u = (umax-umin)/
m_nb_pas;
291 double pas_v = (vmax-vmin)/
m_nb_pas;
302 std::vector<double> lstechan;
304 for(
long i=0;i<lstechan.size()/5;i++)
306 double xyz1[3]={lstechan[5*i],lstechan[5*i+1],lstechan[5*i+2]};
310 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
319 if(ele3->get_solution(0)>En_local)
321 ele3->change_solution(En_local);
322 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
338 double umin,umax,vmin,vmax;
350 double pas_u = (umax-umin)/
m_nb_pas;
351 double pas_v = (vmax-vmin)/
m_nb_pas;
362 std::vector<double> lstechan;
364 for(
long i=0;i<lstechan.size()/5;i++)
366 double xyz1[3]={lstechan[5*i],lstechan[5*i+1],lstechan[5*i+2]};
370 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
379 if(ele3->get_solution(0)>En_local)
381 ele3->change_solution(En_local);
382 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
398 double umin,umax,vmin,vmax;
410 double pas_u = (umax-umin)/
m_nb_pas;
411 double pas_v = (vmax-vmin)/
m_nb_pas;
424 std::vector<double> lstechan;
426 for(
long i=0;i<lstechan.size()/5;i++)
428 double xyz1[3]={lstechan[5*i],lstechan[5*i+1],lstechan[5*i+2]};
429 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
444 if(ele3->get_solution(0)>En_local)
446 ele3->change_solution(En_local);
447 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
464 double pas_t = (tmax-tmin)/
m_nb_pas;
467 double t = tmin+i*pas_t;
473 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
482 if(ele3->get_solution(0)>En_local)
484 ele3->change_solution(En_local);
485 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
502 double pas_t = (tmax-tmin)/
m_nb_pas;
507 double t = tmin+i*pas_t;
510 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
525 if(ele3->get_solution(0)>En_local)
527 ele3->change_solution(En_local);
528 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
541 double dist =
sqrt((xyz2[0]-xyz1[0])*(xyz2[0]-xyz1[0])+(xyz2[1]-xyz1[1])*(xyz2[1]-xyz1[1])+(xyz2[2]-xyz1[2])*(xyz2[2]-xyz1[2]));
556 if(ele3->get_solution(0)>En_local)
558 ele3->change_solution(En_local);
559 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
574 double t=tmin+i*1.0/
m_nb_pas*(tmax-tmin);
581 double cmax=mgarete->
get_M(t);
586 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
594 std::vector<double> lstechan;
596 for(
long i=0;i<lstechan.size()/5;i++)
598 double xyz[3]={lstechan[5*i],lstechan[5*i+1],lstechan[5*i+2]};
603 double uv[2]={lstechan[5*i+3],lstechan[5*i+4]};
610 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3,ele3));
619 LISTE_FEM_NOEUD::iterator itn;
620 double xmin=1e308,ymin=1e308,zmin=1e308,xmax=-1e308,ymax=-1e308,zmax=-1e308;
623 if (no->get_x()>xmax) xmax=no->get_x();
624 if (no->get_y()>ymax) ymax=no->get_y();
625 if (no->get_z()>zmax) zmax=no->get_z();
626 if (no->get_x()<xmin) xmin=no->get_x();
627 if (no->get_y()<ymin) ymin=no->get_y();
628 if (no->get_z()<zmin) zmin=no->get_z();
630 double pas = (xmax-xmin)/
nx;
635 std::map<FEM_ELEMENT3*,FEM_ELEMENT3*>::iterator it_map_ele3;
641 if(it_map_ele3->second->get_solution(0)<ecart_recherche)
643 ele3=it_map_ele3->second;
651 for(
int i=0;i<26;i++)tab_cell[i]=NULL;
681 for(
int i=0;i<26;i++)
683 if(tab_cell[i]!=NULL)
684 if(tab_cell[i]->get_nb_entite()==1)
687 if(ele3_voisin->
get_solution(0)>en_centre*(1.+facteur_augmentation_distance))
689 ele3_voisin->
change_solution(en_centre*(1.+facteur_augmentation_distance));
690 m_map_fem_ele3.insert(std::pair<FEM_ELEMENT3*,FEM_ELEMENT3*>(ele3_voisin,ele3_voisin));
700 LISTE_FEM_NOEUD::iterator it_fem_nd;
703 double ecart_nodal_noeud=0.0;
705 liste_fem_element3 = femnd->get_lien_element3();
706 for(
int i=0;i<liste_fem_element3->
get_nb();i++)
710 ecart_nodal_noeud=ecart_nodal_noeud/liste_fem_element3->
get_nb();
711 femnd->change_solution(ecart_nodal_noeud);
717 LISTE_FEM_NOEUD::iterator itn;
718 double xmin=1e308,ymin=1e308,zmin=1e308,xmax=-1e308,ymax=-1e308,zmax=-1e308;
721 if (no->get_x()>xmax) xmax=no->get_x();
722 if (no->get_y()>ymax) ymax=no->get_y();
723 if (no->get_z()>zmax) zmax=no->get_z();
724 if (no->get_x()<xmin) xmin=no->get_x();
725 if (no->get_y()<ymin) ymin=no->get_y();
726 if (no->get_z()<zmin) zmin=no->get_z();
735 double pas = (xmax-xmin)/
nx;
736 LISTE_FEM_ELEMENT3::iterator it_ele3;
740 ele3->get_boite_3D().get_centre(centre);
750 double dt=1.0/nb_pas;
753 dxyz[0]=xyz2[0]-xyz1[0];
754 dxyz[1]=xyz2[1]-xyz1[1];
755 dxyz[2]=xyz2[2]-xyz1[2];
756 for(
int i=0;i<nb_pas+1;i++)
758 xyz[0]=xyz1[0]+t*dxyz[0];
759 xyz[1]=xyz1[1]+t*dxyz[1];
760 xyz[2]=xyz1[2]+t*dxyz[2];