ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_poutre.cpp
Revision: 283
Committed: Tue Sep 13 21:11:20 2011 UTC (13 years, 8 months ago) by francois
File size: 3329 byte(s)
Log Message:
structure de l'écriture

File Contents

# User Rev Content
1 francois 283 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4     // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6     //------------------------------------------------------------
7     // Le projet MAGIC est un projet de recherche du d�partement
8     // de g�nie m�canique de l'Universit� du Qu�bec �
9     // Trois Rivi�res
10     // Les librairies ne peuvent �tre utilis�es sans l'accord
11     // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // mg_poutre.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20     // Version du 02/03/2006 � 11H22
21     //------------------------------------------------------------
22     //------------------------------------------------------------
23    
24    
25     #include "gestionversion.h"
26     #include "mg_poutre.h"
27     //#include "message.h"
28    
29     MG_POUTRE::MG_POUTRE(std::string idori,unsigned long num):MG_ELEMENT_TOPOLOGIQUE(num,idori),num_materiau(-1)
30     {
31     }
32    
33     MG_POUTRE::MG_POUTRE(std::string idori):MG_ELEMENT_TOPOLOGIQUE(idori),num_materiau(-1)
34     {
35     }
36    
37     MG_POUTRE::MG_POUTRE(MG_POUTRE& mdd):MG_ELEMENT_TOPOLOGIQUE(mdd),lst_boucle(mdd.lst_boucle)
38     {
39     }
40    
41     MG_POUTRE::~MG_POUTRE()
42     {
43     }
44    
45     void MG_POUTRE::ajouter_mg_boucle(class MG_BOUCLE* mgbou)
46     {
47     lst_boucle.insert(lst_boucle.end(),mgbou);
48     }
49    
50     void MG_POUTRE::supprimer_mg_boucle(class MG_BOUCLE* mgbou)
51     {
52     std::vector<MG_BOUCLE*>::iterator i;
53     for (i=lst_boucle.begin();i!=lst_boucle.end();i++)
54     {
55     if ((*i)==mgbou)
56     {
57     lst_boucle.erase(i);
58     return;
59     }
60     }
61     }
62    
63    
64     int MG_POUTRE::get_nb_mg_boucle(void)
65     {
66     return lst_boucle.size();
67     }
68    
69     MG_BOUCLE* MG_POUTRE::get_mg_boucle(int num)
70     {
71     return lst_boucle[num];
72     }
73    
74     int MG_POUTRE::get_dimension(void)
75     {
76     return 1;
77     }
78    
79     void MG_POUTRE::get_topologie_sousjacente(TPL_MAP_ENTITE<MG_ELEMENT_TOPOLOGIQUE*> *lst)
80     {
81     int nb=lst_boucle.size();
82     for (int i=0;i<nb;i++)
83     {
84     MG_BOUCLE* bou=lst_boucle[i];
85     int nb2=bou->get_nb_mg_coarete();
86     for (int j=0;j<nb2;j++)
87     {
88     MG_ARETE* are=bou->get_mg_coarete(j)->get_arete();
89     lst->ajouter(are);
90     are->get_topologie_sousjacente(lst);
91     }
92     }
93     }
94    
95     void MG_POUTRE::enregistrer(std::ostream& o)
96     {
97     o << "%" << get_id() << "=POUTRE(" << get_idoriginal() << ",(";
98     for (unsigned int i=0;i<lst_boucle.size();i++)
99     {
100     o << "$" << lst_boucle[i]->get_id();
101     if (i!=lst_boucle.size()-1) o << ",";
102     else o << ")";
103     }
104     int nb=get_nb_ccf();
105     o << "," << num_materiau << "," << nb;
106     if (nb!=0)
107     {
108     o << ",(";
109     for (int i=0;i<nb;i++)
110     {
111     char nom[3];
112     get_type_ccf(i,nom);
113     o << "(" << nom << "," << get_valeur_ccf(i) << ")";
114     if (i!=nb-1) o << "," ;
115     }
116     o << ")";
117     }
118     o << ");" << std::endl;
119     }
120    
121     void MG_POUTRE::change_num_materiau(int num)
122     {
123     num_materiau=num;
124     }
125    
126     int MG_POUTRE::get_num_materiau(void)
127     {
128     return num_materiau;
129     }
130    
131     VCT& MG_POUTRE::get_vectorisation(void)
132     {
133     VCT *p=NULL;
134     return *p;
135     }