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++)
708 ecart_nodal_noeud+=liste_fem_element3->
get(i)->get_solution(0);
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];
void get_centre(double *coo)
MG_ELEMENT_TOPOLOGIQUE * get_mgeletopo(void)
BOITE_3D get_boite_3D(void)
int echantillonnage(void)
int m_nb_cellule_direction
TPL_GRILLE< FEM_ELEMENT3 * > m_grille_ele3
std::map< FEM_ELEMENT3 *, FEM_ELEMENT3 * > m_map_fem_ele3
void echantillonnage_sommet_sommet(MG_SOMMET *mgsommet1, MG_SOMMET *mgsommet2)
void echantillonnage_arete_face(MG_ARETE *mgarete, MG_FACE *mgface)
~FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE()
void echantillonnage_ele_topo_ele_topo(MG_ELEMENT_TOPOLOGIQUE *eletopo1, MG_ELEMENT_TOPOLOGIQUE *eletopo2)
FCT_TAILLE_FEM_SOLUTION_GENERATEUR_MICROSTRUCTURE(MG_GESTIONNAIRE *gesttmp, MG_GEOMETRIE *geotmp, double dg, double dg_eps_particule, int fechantillon, int nb_cellule_direction, char *nomsolution, TPL_MAP_ENTITE< MG_VOLUME * > &tpl_map_volume_matrice, long nb_couche_min=2, long nb_pas=32, double facteur_augmentation=25)
void echantillonnage_sommet_arete(MG_SOMMET *mgsommet, MG_ARETE *mgarete)
void echantillonnage_face(MG_FACE *mgface)
void get_fem_ele3_droite(double *xyz1, double *xyz2, TPL_MAP_ENTITE< FEM_ELEMENT3 * > &tpl_map_ele3, int nb_pas=32)
double m_dg_eps_particule
bool lien_topologique_entre(MG_ELEMENT_TOPOLOGIQUE *mg_ele_topo1, MG_ELEMENT_TOPOLOGIQUE *mg_ele_topo2)
void echantillonnage_arete(MG_ARETE *mgarete)
void lisser_solution(void)
void echantillonnage_face_face(MG_FACE *mgface1, MG_FACE *mgface2)
void extrapoler_solution_noeud(void)
virtual void construit_particulier(void)
void echantillonnage_arete_arete(MG_ARETE *mgarete1, MG_ARETE *mgarete2)
void echantillonnage_sommet_face(MG_SOMMET *mgsommet, MG_FACE *mgface)
double m_facteur_augmentation
TPL_MAP_ENTITE< MG_VOLUME * > m_tpl_map_volume_matrice
void affiche(char *message)
virtual BOITE_3D & get_boite_3D(void)=0
virtual double get_solution(int num=0)
virtual void change_solution(double val, int num=0)
FEM_NOEUD * get_premier_noeud(LISTE_FEM_NOEUD::iterator &it)
FEM_ELEMENT3 * get_suivant_element3(LISTE_FEM_ELEMENT3::iterator &it)
FEM_NOEUD * get_suivant_noeud(LISTE_FEM_NOEUD::iterator &it)
FEM_ELEMENT3 * get_premier_element3(LISTE_FEM_ELEMENT3::iterator &it)
void ecrire(double val, int i, int j, int coord=0, int num_no=0)
virtual double get_tmax(void)
virtual double get_tmin(void)
virtual void evaluer(double t, double *xyz)
virtual double get_M(double t)
virtual int get_type(void)=0
virtual void get_courbure(double *uv, double &cmax, double &cmin)
virtual void get_echantillonnage(int numechantillon, std::vector< double > &tab)
virtual MG_SURFACE * get_surface(void)
MG_ARETE * get_suivant_arete(LISTE_MG_ARETE::iterator &it)
MG_ARETE * get_premier_arete(LISTE_MG_ARETE::iterator &it)
MG_FACE * get_premier_face(LISTE_MG_FACE::iterator &it)
MG_SOMMET * get_suivant_sommet(LISTE_MG_SOMMET::iterator &it)
MG_SOMMET * get_premier_sommet(LISTE_MG_SOMMET::iterator &it)
unsigned int get_nb_mg_volume(void)
MG_FACE * get_suivant_face(LISTE_MG_FACE::iterator &it)
MG_VOLUME * get_suivant_volume(LISTE_MG_VOLUME::iterator &it)
MG_VOLUME * get_premier_volume(LISTE_MG_VOLUME::iterator &it)
virtual void evaluer(double *xyz)=0
virtual MG_POINT * get_point(void)
virtual int est_periodique_u(void)=0
virtual double get_periode_u(void)=0
virtual int est_periodique_v(void)=0
virtual double get_periode_v(void)=0
virtual BOITE_3D get_boite_3D(void)
static void get_param_face(MG_FACE *mgface, double &umin, double &umax, double &vmin, double &vmax)
static int get_distance_min_mg_eletopo_mg_eletopo(MG_ELEMENT_TOPOLOGIQUE *mgeletopo1, MG_ELEMENT_TOPOLOGIQUE *mgeletopo2, double &distance)
static int get_lien_topologique(MG_ELEMENT_TOPOLOGIQUE *mgeletopo1, MG_ELEMENT_TOPOLOGIQUE *mgeletopo2)
static void get_map_mg_face_sous_jacent(MG_ELEMENT_TOPOLOGIQUE *mgeletopo, TPL_MAP_ENTITE< MG_FACE * > &map_face)
static void get_map_mg_arete_sous_jacent(MG_ELEMENT_TOPOLOGIQUE *mgeletopo, TPL_MAP_ENTITE< MG_ARETE * > &map_arete)
static int projection_au_plus_pres_sur_mg_face(double *xyz1, MG_FACE *mgface1, MG_FACE *mgface2, double *xyz2)
static int get_distance_min_mg_face_mg_face(MG_FACE *mgface1, MG_FACE *mgface2, double &distance)
static void get_map_mg_sommet_sous_jacent(MG_ELEMENT_TOPOLOGIQUE *mgeletopo, TPL_MAP_ENTITE< MG_SOMMET * > &map_sommet)
static int projection_au_plus_pres_sur_mg_arete(double *xyz, MG_ARETE *mgarete, double *xyz2)
TPL_LISTE_ENTITE< A > lst_entite_A
virtual void supprimer(A a)
virtual void inserer(A a)
virtual TPL_CELLULE_GRILLE< A > * get_cellule(int num)
virtual void rechercher(BOITE_3D bt, TPL_MAP_ENTITE< A > &liste_entite_trouve)
virtual void initialiser(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, int nb_pasx, int nb_pasy, int nb_pasz)
virtual void ajouter(X x)
virtual X get_premier(ITERATEUR &it)
virtual X get_suivant(ITERATEUR &it)
virtual void ajouter(X x)
std::map< unsigned long, X, std::less< unsigned long > >::iterator ITERATEUR
double2 sqrt(double2 &val)