MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_poutre.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 //####// mg_poutre.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:55 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 #include "mg_poutre.h"
26 
27 MG_POUTRE::MG_POUTRE(std::string idori,unsigned long num):MG_ELEMENT_TOPOLOGIQUE(num,idori),num_materiau(-1)
28 {
29 }
30 
31 MG_POUTRE::MG_POUTRE(std::string idori):MG_ELEMENT_TOPOLOGIQUE(idori),num_materiau(-1)
32 {
33 }
34 
35 MG_POUTRE::MG_POUTRE(MG_POUTRE& mdd):MG_ELEMENT_TOPOLOGIQUE(mdd),lst_boucle(mdd.lst_boucle)
36 {
37 }
38 
40 {
41 }
42 
44 {
45  lst_boucle.insert(lst_boucle.end(),mgbou);
46 }
48 {
49 return false;
50 }
52 {
53  std::vector<MG_BOUCLE*>::iterator i;
54  for (i=lst_boucle.begin();i!=lst_boucle.end();i++)
55  {
56  if ((*i)==mgbou)
57  {
58  lst_boucle.erase(i);
59  return;
60  }
61  }
62 }
63 
64 
66 {
67  return lst_boucle.size();
68 }
69 
71 {
72  return lst_boucle[num];
73 }
74 
76 {
77  BOITE_3D boite3d;
78  long k=0;
79  std::vector<MG_BOUCLE*>::iterator it;
80  for(it=lst_boucle.begin();it!=lst_boucle.end();it++)
81  {
82  MG_BOUCLE* boucle=*it;
83  long nb_coarete=boucle->get_nb_mg_coarete();
84  for(long i=0;i<nb_coarete;i++)
85  {
86  if(k==0)
87  {
88  boite3d = boucle->get_mg_coarete(i)->get_arete()->get_boite_3D();
89  }
90  else boite3d=boite3d+boucle->get_mg_coarete(i)->get_arete()->get_boite_3D();
91  k++;
92  }
93  }
94  return boite3d;
95 }
96 
98 {
99  return 1;
100 }
101 
103 {
104  return TYPE_ELEMENT_TOPOLOGIQUE::POUTRE;
105 }
106 
108 {
109  int nb=lst_boucle.size();
110  for (int i=0;i<nb;i++)
111  {
112  MG_BOUCLE* bou=lst_boucle[i];
113  int nb2=bou->get_nb_mg_coarete();
114  for (int j=0;j<nb2;j++)
115  {
116  MG_ARETE* are=bou->get_mg_coarete(j)->get_arete();
117  lst->ajouter(are);
118  are->get_topologie_sousjacente(lst);
119  }
120  }
121 }
122 
123 void MG_POUTRE::enregistrer(std::ostream& o,double version)
124 {
125  o << "%" << get_id() << "=POUTRE(" << get_idoriginal() << ",(";
126  for (unsigned int i=0;i<lst_boucle.size();i++)
127  {
128  o << "$" << lst_boucle[i]->get_id();
129  if (i!=lst_boucle.size()-1) o << ",";
130  else o << ")";
131  }
132  int nb=get_nb_ccf();
133  if (version<2)
134  {
135  o << "," << num_materiau << "," << nb;
136  if (nb!=0)
137  {
138  o << ",(";
139  for (int i=0;i<nb;i++)
140  {
141  char nom[3];
142  get_type_ccf(i,nom);
143  o << "(" << nom << "," << get_valeur_ccf(i) << ")";
144  if (i!=nb-1) o << "," ;
145  }
146  o << ")";
147  }
148  o << ");" << std::endl;
149  }
150  else
151  {
152  o << "," ;
153  enregistrer_ccf(o,version);
154  o << ");" << std::endl;
155  }
156 }
157 
159 {
160  num_materiau=num;
161 }
162 
164 {
165  return num_materiau;
166 }
168 {
169 bool res=get_lien_maillage()->contient(ele);
170 return res;
171 }
172 
174 {
175  VCT *p=NULL;
176  return *p;
177 }
mg_poutre.h
TPL_SET::contient
bool contient(X x)
Definition: tpl_set.h:72
MG_POUTRE::get_num_materiau
int get_num_materiau(void)
Definition: mg_poutre.cpp:163
MG_BOUCLE
Definition: mg_boucle.h:35
gestionversion.h
MG_BOUCLE::get_nb_mg_coarete
virtual int get_nb_mg_coarete(void)
Definition: mg_boucle.cpp:78
TPL_MAP_ENTITE< MG_ELEMENT_TOPOLOGIQUE * >
MG_POUTRE::ajouter_mg_boucle
virtual void ajouter_mg_boucle(class MG_BOUCLE *mgbou)
Definition: mg_poutre.cpp:43
MG_POUTRE::lst_boucle
std::vector< MG_BOUCLE * > lst_boucle
Definition: mg_poutre.h:59
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
MG_POUTRE::get_vectorisation
virtual VCT & get_vectorisation(void)
Definition: mg_poutre.cpp:173
MG_POUTRE::MG_POUTRE
MG_POUTRE(std::string idori, unsigned long num)
Definition: mg_poutre.cpp:27
MG_POUTRE::num_materiau
int num_materiau
Definition: mg_poutre.h:60
MG_POUTRE::enregistrer
virtual void enregistrer(std::ostream &o, double version)
Definition: mg_poutre.cpp:123
MG_POUTRE::get_mg_boucle
virtual MG_BOUCLE * get_mg_boucle(int num)
Definition: mg_poutre.cpp:70
MG_ELEMENT_MAILLAGE
Definition: mg_element_maillage.h:38
MG_POUTRE::get_dimension
virtual int get_dimension(void)
Definition: mg_poutre.cpp:97
MG_POUTRE::get_boite_3D
virtual BOITE_3D get_boite_3D(void)
Definition: mg_poutre.cpp:75
MG_ELEMENT_TOPOLOGIQUE::get_lien_maillage
virtual TPL_SET< MG_ELEMENT_MAILLAGE * > * get_lien_maillage(void)
Definition: mg_element_topologique.cpp:62
MG_POUTRE
Definition: mg_poutre.h:33
MG_ELEMENT_TOPOLOGIQUE::get_type_ccf
virtual void get_type_ccf(int num, char *nom)
Definition: mg_element_topologique.cpp:95
MG_ELEMENT_TOPOLOGIQUE
Definition: mg_element_topologique.h:51
MG_ARETE::get_topologie_sousjacente
virtual void get_topologie_sousjacente(TPL_MAP_ENTITE< MG_ELEMENT_TOPOLOGIQUE * > *lst)
Definition: mg_arete.cpp:57
MG_POUTRE::change_num_materiau
void change_num_materiau(int num)
Definition: mg_poutre.cpp:158
MG_POUTRE::get_nb_mg_boucle
virtual int get_nb_mg_boucle(void)
Definition: mg_poutre.cpp:65
MG_ELEMENT_TOPOLOGIQUE::get_nb_ccf
virtual int get_nb_ccf(void)
Definition: mg_element_topologique.cpp:154
MG_POUTRE::get_topologie_sousjacente
virtual void get_topologie_sousjacente(TPL_MAP_ENTITE< MG_ELEMENT_TOPOLOGIQUE * > *lst)
Definition: mg_poutre.cpp:107
MG_POUTRE::est_une_topo_element
virtual bool est_une_topo_element(void)
Definition: mg_poutre.cpp:47
MG_POUTRE::contient_element
virtual bool contient_element(MG_ELEMENT_MAILLAGE *ele)
Definition: mg_poutre.cpp:167
TPL_MAP_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_map_entite.h:55
BOITE_3D
Definition: ot_boite_3d.h:27
MG_BOUCLE::get_mg_coarete
virtual MG_COARETE * get_mg_coarete(int num)
Definition: mg_boucle.cpp:84
MG_POUTRE::supprimer_mg_boucle
virtual void supprimer_mg_boucle(class MG_BOUCLE *mgbou)
Definition: mg_poutre.cpp:51
MG_ARETE::get_boite_3D
virtual BOITE_3D get_boite_3D(void)
Definition: mg_arete.cpp:116
MG_ELEMENT_TOPOLOGIQUE::enregistrer_ccf
virtual void enregistrer_ccf(std::ostream &o, double version)
Definition: mg_element_topologique.cpp:364
res
#define res(i, j)
MG_ARETE
Definition: mg_arete.h:36
MG_ELEMENT_TOPOLOGIQUE::get_valeur_ccf
virtual bool get_valeur_ccf(char *nom, double &val)
Definition: mg_element_topologique.cpp:310
MG_ELEMENT_TOPOLOGIQUE::get_idoriginal
virtual std::string get_idoriginal(void)
Definition: mg_element_topologique.cpp:299
MG_POUTRE::~MG_POUTRE
virtual ~MG_POUTRE()
Definition: mg_poutre.cpp:39
MG_COARETE::get_arete
virtual MG_ARETE * get_arete(void)
Definition: mg_coarete.cpp:58
MG_POUTRE::get_type
virtual int get_type(void)
Definition: mg_poutre.cpp:102
VCT
Definition: vct.h:33