69 std::vector<MG_CG_GROUPE_FORME*>::iterator it_gr_forme;
169 if((*it_gr_forme)->get_nom()==nom) groupe_forme=*it_gr_forme;
172 if(groupe_forme==NULL)
return 0.0;
173 double fraction_volumique=0.0;
181 return fraction_volumique;
198 plan_x0yz=
false;plan_x1yz=
false;plan_xy0z=
false;plan_xy1z=
false;plan_xyz0=
false;plan_xyz1=
false;
232 for(
int i=0;i<nb_mg_coarete-1;i++)
235 for(
int j=i+1;j<nb_mg_coarete;j++)
249 double t = tmin+k*pas_t;
306 double volume_inclusion=0;
307 std::map<long,MG_VOLUME*>::iterator it_volume;
343 if(forme_matrice!=NULL)
345 if(forme_matrice->
get_type_forme()==MG_CG_FORME::TYPE_FORME::VOLUME)
350 else if(forme_matrice->
get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
353 std::map<long,MG_VOLUME*>::iterator it_volume;
364 tpl_map_ele_topo_matrice.
ajouter(face);
365 tpl_grille_ele_topo.
inserer(face);
373 tpl_map_ele_topo_matrice.
ajouter(arete);
374 tpl_grille_ele_topo.
inserer(arete);
376 tpl_map_arete.
vide();
380 tpl_map_ele_topo_matrice.
ajouter(sommet);
381 tpl_grille_ele_topo.
inserer(sommet);
383 tpl_map_sommet.
vide();
386 std::stack<MG_ELEMENT_TOPOLOGIQUE*> stack_ele_topo;
390 tpl_grille_ele_topo.
inserer(face);
391 stack_ele_topo.push(face);
398 tpl_grille_ele_topo.
inserer(arete);
399 stack_ele_topo.push(arete);
404 tpl_grille_ele_topo.
inserer(sommet);
405 stack_ele_topo.push(sommet);
407 while(!stack_ele_topo.empty())
417 tpl_grille_ele_topo.
rechercher(boite_recherche,tpl_map_topo_trouve);
421 if(ele_topo==ele_top_trouve)
continue;
438 std::vector<MG_CG_FORME*>::iterator it_forme;
440 std::vector<MG_CG_OPERATEUR*>::iterator it_operateur;
452 while(tpl_map_face_volume1.
get_nb()>0 && tpl_map_face_volume2.
get_nb()>0)
457 while(trouve==
false && face2!=NULL)
459 double distance_moyenne;
460 double ecart_type_distance;
463 if(
OPERATEUR::egal(distance_moyenne,decallage,precision) && ecart_type_distance<precision)
469 else if(
OPERATEUR::egal(distance_moyenne,0.0,precision) && ecart_type_distance<precision)
478 if(trouve==
false)
return FAIL;
485 double fraction_volumique_cible,
487 double &fraction_volumique_actuelle,
488 std::vector<MG_CG_FORME*> &vector_inclusion_genere,
489 int &position_relative,
490 std::vector< double > *vector_epaisseur_couche,
498 double volume_particule;
500 std::vector<MG_CG_FORME*> vector_forme_genere;
501 std::vector<MG_CG_OPERATEUR*> vector_operateur_genere;
502 vector_forme_genere.push_back(forme_inclusion);
504 if(forme_inclusion->
get_type_forme()!=MG_CG_FORME::TYPE_FORME::VOLUME)
511 bool multicouche=
false;
512 if(vector_epaisseur_couche!=NULL) multicouche=
true;
516 double decallage_max=0;
517 std::vector<double>::iterator it_epaisseur;
518 for(it_epaisseur=vector_epaisseur_couche->begin();it_epaisseur!=vector_epaisseur_couche->end();it_epaisseur++) decallage_max+=*it_epaisseur;
520 vector_operateur_genere.push_back(op_decallage_couche_externe);
534 forme_volume_verif_grille=forme_volume_couche_externe;
546 if((volume_particule+fraction_volumique_actuelle)>fraction_volumique_cible+eps_fra_vol)
552 bool plan_x0yz_inc;
bool plan_x1yz_inc;
bool plan_xy0z_inc;
bool plan_xy1z_inc;
bool plan_xyz0_inc;
bool plan_xyz1_inc;
553 bool plan_x0yz_ext;
bool plan_x1yz_ext;
bool plan_xy0z_ext;
bool plan_xy1z_ext;
bool plan_xyz0_ext;
bool plan_xyz1_ext;
554 int position_relative_inc=
position_relative_inclusion_ves(volume_inclusion,plan_x0yz_inc,plan_x1yz_inc,plan_xy0z_inc,plan_xy1z_inc,plan_xyz0_inc,plan_xyz1_inc);
555 int position_relative_ext=
position_relative_inclusion_ves(volume_inclusion_couche_externe,plan_x0yz_ext,plan_x1yz_ext,plan_xy0z_ext,plan_xy1z_ext,plan_xyz0_ext,plan_xyz1_ext);
569 if(plan_x0yz_inc==plan_x0yz_ext)
570 if(plan_x1yz_inc==plan_x1yz_ext)
571 if(plan_xy0z_inc==plan_xy0z_ext)
572 if(plan_xy1z_inc==plan_xy1z_ext)
573 if(plan_xyz0_inc==plan_xyz0_ext)
574 if(plan_xyz1_inc==plan_xyz1_ext) ok_plan=
true;
583 vector_operateur_genere.push_back(op_inter_ext);
598 vector_operateur_genere.push_back(op_inc_matrice_ext);
623 vector_operateur_genere.push_back(op_diff_porosite);
640 vector_operateur_genere.push_back(op_inter_couche);
653 vector_operateur_genere.push_back(op_inc_matrice_coeur);
684 vector_inclusion_genere.push_back(inclusion_coeur);
688 for(it_epaisseur=vector_epaisseur_couche->begin();it_epaisseur!=vector_epaisseur_couche->end()-1;it_epaisseur++)
690 epaisseur=*it_epaisseur;
691 decallage+=*it_epaisseur;
693 vector_operateur_genere.push_back(op_decallage_couche);
707 vector_operateur_genere.push_back(op_inter_couche);
720 vector_operateur_genere.push_back(op_inc_matrice_couche);
735 vector_inclusion_genere.push_back(inclusion_couche);
742 epaisseur=*it_epaisseur;
746 vector_inclusion_genere.push_back(matrice_couche_partielle);
748 position_relative=position_relative_ext;
762 if(((volume_particule/
m_boite3d_ves.
get_volume())+fraction_volumique_actuelle)>fraction_volumique_cible+eps_fra_vol)
768 bool plan_x0yz;
bool plan_x1yz;
bool plan_xy0z;
bool plan_xy1z;
bool plan_xyz0;
bool plan_xyz1;
783 vector_operateur_genere.push_back(op_inter);
798 vector_operateur_genere.push_back(op_inc_matrice);
805 vector_forme_genere.push_back(matrice);
820 vector_inclusion_genere.push_back(forme_volume_inclusion);
821 forme_volume_verif_grille=forme_volume_inclusion;
830 double& fraction_volumique_actuelle,
831 std::vector< MG_CG_FORME* >& vector_inclusion_genere,
832 int& position_relative
836 double volume_particule;
838 std::vector<MG_CG_FORME*> vector_forme_genere;
839 std::vector<MG_CG_OPERATEUR*> vector_operateur_genere;
840 vector_forme_genere.push_back(forme_inclusion);
843 if(forme_inclusion->
get_type_forme()!=MG_CG_FORME::TYPE_FORME::VOLUME)
866 bool plan_x0yz;
bool plan_x1yz;
bool plan_xy0z;
bool plan_xy1z;
bool plan_xyz0;
bool plan_xyz1;
887 vector_operateur_genere.push_back(op_inter);
904 vector_operateur_genere.push_back(op_inc_matrice);
913 vector_forme_genere.push_back(matrice);
952 vector_inclusion_genere.push_back(forme_volume_inclusion);
953 forme_volume_verif_grille=forme_volume_inclusion;
955 fraction_volumique_actuelle+=volume_particule;
974 while(volume_recherche!=NULL)
980 else volume_recherche=map_volume_recherche.
get_suivant(it_volume);
995 if(map_sommet_volume2.
existe(sommet))
return true;
1002 if(vector_epaisseur_couches==NULL)
1007 vector_groupe_forme.push_back(groupe_forme);
1014 vector_groupe_forme.push_back(groupe_forme);
1015 for(
int i=0;i<vector_epaisseur_couches->size();i++)
1017 char nom_couche[500];
1018 sprintf(nom_couche,
"%s_%i",nom.c_str(),i);
1021 vector_groupe_forme.push_back(groupe_forme);
1033 if(forme->
get_type_forme()==MG_CG_FORME::TYPE_FORME::MULTI_VOLUME)
1036 std::map<long,MG_VOLUME*>::iterator it_volume;
1052 std::cout <<
"NB_FACE = " << tpl_map_face.
get_nb() << std::endl;
1053 while(tpl_map_face.
get_nb()>=2)
1059 while(trouve==
false && face1!=NULL && face2!=NULL)
1061 double distance_moyenne;
1062 double ecart_type_distance;
1064 std::cout <<
" Distance = " << distance_moyenne <<
" Std-dev = " << ecart_type_distance <<
" Epaisseur = " << epaisseur << std::endl;
1067 std::cout <<
" Correspondance : " << face1->
get_id() <<
" , " << face2->
get_id() << std::endl;
1069 bool face1_base=
false;
1070 bool face2_base=
false;
1071 if(face1_base==
true)
1075 else if(face2_base==
true)
1083 if(aire_face1<aire_face2)
int contient(double x, double y, double z)
void change_grosseur(double f)
virtual double get_tmax(void)
virtual double get_tmin(void)
virtual void evaluer(double t, double *xyz)
virtual class MG_COURBE * get_courbe(void)
virtual MG_COARETE * get_mg_coarete(int num)
virtual int get_nb_mg_coarete(void)
virtual MG_FACE * get_mg_face(void)
virtual MG_VOLUME * get_premier_mg_volume(std::map< long, MG_VOLUME * >::iterator &it)
virtual MG_VOLUME * get_suivant_mg_volume(std::map< long, MG_VOLUME * >::iterator &it)
virtual MG_VOLUME * get_mg_volume(void)
virtual int construire(void)
virtual int get_type_forme(void)=0
TPL_MAP_ENTITE< MG_VOLUME * > get_tpl_map_volume(void)
virtual void change_epsilon_triangulation(double val)
virtual void change_fusionner_entite_similaire(bool val)
virtual void change_importer_triangulation(bool val)
virtual int supprimer_mgcg_formeid(long id, bool avec_mg_element=true)
virtual int supprimer_mgcg_operateurid(long id)
virtual int construire(void)=0
virtual int construire(void)=0
virtual MG_CG_FORME * get_mgcg_forme_sortie(void)
virtual MG_CG_FORME * get_mgcg_forme_matrice_sortie(void)
virtual int construire(void)=0
virtual MG_CG_FORME * get_mgcg_forme_inclusion_sortie(void)
virtual int construire(void)=0
virtual void change_decallage(double decallage)
virtual MG_CG_FORME * get_mgcg_forme_sortie(void)
static MG_CG_OP_TRANSF_DECALLAGE * creer_MG_CG_OP_TRANSF_DECALLAGE(MG_CG_MODELE *mgcg_modele, int semantique, MG_CG_FORME *mgcg_forme_entree)
static MG_CG_OP_BOOL_DIFFERENCE * creer_MG_CG_OP_BOOL_DIFFERENCE(MG_CG_MODELE *mgcg_modele, int semantique, MG_CG_FORME *mgcg_forme_entree_1, MG_CG_FORME *mgcg_forme_entree_2)
static MG_CG_OP_BOOL_INTERSECTION * creer_MG_CG_OP_BOOL_INTERSECTION(MG_CG_MODELE *mgcg_modele, int semantique, MG_CG_FORME *mgcg_forme_entree_1, MG_CG_FORME *mgcg_forme_entree_2)
static MG_CG_OP_INCLUSION_MATRICE * creer_MG_CG_OP_INCLUSION_MATRICE(MG_CG_MODELE *mgcg_modele, int semantique, MG_CG_FORME *mgcg_forme_inclusion_entree, MG_CG_FORME *mgcg_forme_matrice_entree)
static MG_CG_INFO_STRING * creer_MG_CG_INFO_STRING(MG_CONSTRUCTION_GEOMETRIQUE *mg_construction_geometrique, std::string identifiant, std::string valeur)
static MG_CG_INFO_DOUBLE * creer_MG_CG_INFO_DOUBLE(MG_CONSTRUCTION_GEOMETRIQUE *mg_construction_geometrique, std::string identifiant, double valeur)
static MG_CG_MODELE * creer_MG_CG_MODELE(MG_GESTIONNAIRE *mg_gestionnaire, std::string nom_mgcg_modele, double unite=1.0, double eps=1e-6)
static MG_CG_GROUPE_FORME * creer_MG_CG_GROUPE_FORME(MG_CG_MODELE *mgcg_modele, std::string nom)
static MG_CG_FORME_VOLUME_BOITE * creer_MG_CG_FORME_VOLUME_BOITE(MG_CG_MODELE *mgcg_modele, double x1, double y1, double z1, double x2, double y2, double z2)
virtual MG_BOUCLE * get_boucle(void)
virtual int est_periodique(void)=0
virtual double get_periode(void)=0
static void change_pas_echantillon(int val)
static void restaure_pas_echantillon(void)
virtual BOITE_3D get_boite_3D(void)=0
virtual void inverser(double *uv, double *xyz, double precision=1e-6)
virtual void calcul_normale_unitaire(double *uv, double *normale)
int ajouter_mgcg_modele(MG_CG_MODELE *mgcg_modele)
virtual BOITE_3D get_boite_3D(void)
virtual void ajouter_face_correspondante(MG_FACE *face1, MG_FACE *face2)
void active_affichage(fonction_affiche *fonc)
void change_precision(double precision)
MSTRUCT_GENERATEUR(MG_GESTIONNAIRE *mg_gestionnaire, char *nom_mgcg_modele)
bool longueur_acceptable(MG_ARETE *mgarete)
double get_fraction_volumique_groupe_forme(std::string nom)
void change_longueur_min(double longueur_min)
void affiche(char *message)
void initialiser_grille(void)
TPL_GRILLE< MG_VOLUME * > m_grille_volume_inclusion
std::vector< MG_CG_GROUPE_FORME * > m_vector_mgcg_groupe_forme_inclusion
virtual MG_CG_MODELE * get_mgcg_modele(void)
bool configuration_acceptable(MG_CG_FORME_VOLUME *forme_volume_inclusion, MG_CG_FORME *forme_matrice=NULL)
MG_CG_FORME * m_cube_initial
bool distance_acceptable_bord_ves(MG_VOLUME *mgvolume)
fonction_affiche * fonc_affiche
void change_intersection_bords_ves(bool intersection_bords_ves)
bool angle_entre_face_acceptable(MG_ARETE *mgarete)
MG_GESTIONNAIRE * m_mg_gestionnaire
bool m_intersection_bords_ves
BOITE_3D m_boite3d_distribution
virtual MG_GESTIONNAIRE * get_mg_gestionnaire(void)
void change_volume_min(double volume_min)
MG_CG_MODELE * m_mgcg_modele
bool insertion_inclusion(MG_CG_FORME *forme_inclusion, double fraction_volumique_cible, double eps_fra_vol, double &fraction_volumique_actuelle, std::vector< MG_CG_FORME * > &vector_inclusion_genere, int &position_relative, std::vector< double > *vector_epaisseur_couche=NULL, bool porosite=false)
void change_angle_min(double angle_min)
void cree_vector_groupe_forme(std::string nom, std::vector< MG_CG_GROUPE_FORME * > &vector_groupe_forme, std::vector< double > *vector_epaisseur_couches=NULL)
void echec_insertion_inclusion(std::vector< MG_CG_FORME * > &vector_forme, std::vector< MG_CG_OPERATEUR * > &vector_operateur)
void change_aire_min(double aire_min)
bool positionnement_acceptable(MG_VOLUME *inclusion)
~MSTRUCT_GENERATEUR(void)
bool lien_topologique_entre(MG_ELEMENT_TOPOLOGIQUE *mg_ele_topo1, MG_ELEMENT_TOPOLOGIQUE *mg_ele_topo2)
int m_nb_pas_echantillonnage
int position_relative_inclusion_ves(MG_VOLUME *inclusion, bool &plan_x0yz, bool &plan_x1yz, bool &plan_xy0z, bool &plan_xy1z, bool &plan_xyz0, bool &plan_xyz1)
bool volume_acceptable(MG_VOLUME *mgvolume)
int faces_correspondantes(MG_VOLUME *volume1, MG_VOLUME *volume2, double decallage, int nb_pas=32, double precision=1.0e-06)
bool aire_acceptable(MG_FACE *mgface)
void change_boite3d_distribution(BOITE_3D boite3d_distribution)
void change_nb_pas_grille(int nb_pas_grille)
virtual void change_mgcg_modele(MG_CG_MODELE *mgcg_modele)
bool volume_intersection_ves_acceptable(MG_VOLUME *mgvolume)
int configurer_volume_mince(MG_CG_FORME *forme, double epaisseur)
void change_nb_pas_echantillonage(int nb_pas_echantillonnage)
void change_boite3d_ves(BOITE_3D boite3d_ves)
void change_distance_inter_volume_min(double distance_min)
static int egal(double a, double b, double eps)
static int get_distance_min_mg_eletopo_mg_eletopo(MG_ELEMENT_TOPOLOGIQUE *mgeletopo1, MG_ELEMENT_TOPOLOGIQUE *mgeletopo2, double &distance)
static double get_aire(MG_FACE *mgface, double eps=0.001)
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 int get_distance_min_mg_volume_mg_volume(MG_VOLUME *mgvolume1, MG_VOLUME *mgvolume2, double &distance)
static void get_map_mg_ele_topo_sous_jacent(MG_ELEMENT_TOPOLOGIQUE *mgeletopo, TPL_MAP_ENTITE< MG_SOMMET * > &map_sommet, TPL_MAP_ENTITE< MG_ARETE * > &map_arete, TPL_MAP_ENTITE< MG_FACE * > &map_face)
static void get_map_mg_sommet_sous_jacent(MG_ELEMENT_TOPOLOGIQUE *mgeletopo, TPL_MAP_ENTITE< MG_SOMMET * > &map_sommet)
static double get_volume(MG_VOLUME *mgvolume, double eps=0.001)
static BOITE_3D get_boite_3D(MG_VOLUME *mgvolume)
static double get_volume_intersection(MG_VOLUME *mgvolume1, MG_VOLUME *mgvolume2, double eps=0.001)
static int declage_mg_face_mg_face(MG_FACE *mgface1, MG_FACE *mgface2, double &moyenne_distance, double &ecart_type_distance, int nb_pas=32, double eps=0.000001)
static double get_longueur(MG_ARETE *mgarete)
virtual double get_longueur(void) const
virtual void supprimer(A a)
virtual void inserer(A a)
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 X get_premier(ITERATEUR &it)
virtual X get_suivant(ITERATEUR &it)
virtual void ajouter(X x)
virtual void supprimer(X x)
std::map< unsigned long, X, std::less< unsigned long > >::iterator ITERATEUR
void fonction_affiche(char *)
double2 acos(double2 &val)