ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/mg_noeud.cpp
Revision: 876
Committed: Fri Mar 24 19:40:04 2017 UTC (8 years, 1 month ago) by francois
File size: 5835 byte(s)
Log Message:
ajouts des elements pentaedriques dans le mg_maillage et dans le fem_maillage (6 et 15 noeuds).
+notion sur les coquilles minces (incomplet)
+operations sur les fem_solution

-->a venir reste sur les coquilles minces + mailleur coquille mince

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_noeud.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_noeud.h"
27     //#include "affiche.h"
28     //#include "message.h"
29 francois 481 #include "ot_boite_2d.h"
30 francois 283 #include "mg_maillage.h"
31    
32    
33    
34    
35     MG_NOEUD::MG_NOEUD(unsigned long num,MG_ELEMENT_TOPOLOGIQUE* topo,double xx,double yy,double zz,int origine):MG_ELEMENT_MAILLAGE(num,topo,origine)
36     {
37     xyz[0]=xx;
38     xyz[1]=yy;
39     xyz[2]=zz;
40     if (topo==NULL) return;
41     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
42     }
43    
44     MG_NOEUD::MG_NOEUD(MG_ELEMENT_TOPOLOGIQUE* topo,double xx,double yy,double zz,int origine):MG_ELEMENT_MAILLAGE(topo,origine)
45     {
46     xyz[0]=xx;
47     xyz[1]=yy;
48     xyz[2]=zz;
49     if (topo==NULL) return;
50     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
51     }
52    
53     MG_NOEUD::MG_NOEUD(MG_NOEUD& mdd):MG_ELEMENT_MAILLAGE(mdd)
54     {
55     xyz[0]=mdd.xyz[0];
56     xyz[1]=mdd.xyz[1];
57     xyz[2]=mdd.xyz[2];
58     if (mdd.get_lien_topologie()==NULL) return;
59     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->ajouter(this);
60     }
61    
62     MG_NOEUD* MG_NOEUD::dupliquer(MG_MAILLAGE *mgmai,long decalage)
63     {
64 francois 791 MG_NOEUD* noeud=new MG_NOEUD(this->get_id()+decalage,liaison_topologique,xyz[0],xyz[1],xyz[2],MAGIC::ORIGINE::DUPLIQUER);
65 francois 283 mgmai->ajouter_mg_noeud(noeud);
66     return noeud;
67     }
68    
69     MG_NOEUD::~MG_NOEUD()
70     {
71     // if (this->get_lien_segment()->get_nb()!=0) afficheur << WARNOEUDSEGMENT << this->get_id()<< enderr;
72     // if (this->get_lien_petit_segment()->get_nb()!=0) afficheur << WARNOEUDSEGMENT << this->get_id()<< enderr;
73     // if (this->get_lien_triangle()->get_nb()!=0) afficheur << WARNOEUDTRIANGLE << this->get_id()<< enderr;
74     // if (this->get_lien_petit_triangle()->get_nb()!=0) afficheur << WARNOEUDTRIANGLE << this->get_id()<< enderr;
75     // if (this->get_lien_tetra()->get_nb()!=0) afficheur << WARNOEUDTETRA << this->get_id()<< enderr;
76     // if (this->get_lien_petit_tetra()->get_nb()!=0) afficheur << WARNOEUDTETRA << this->get_id()<< enderr;
77     if (liaison_topologique==NULL) return;
78     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_maillage()->supprimer(this);
79     }
80    
81     int MG_NOEUD::get_type_entite(void)
82     {
83     return IDMG_NOEUD;
84     }
85    
86     double MG_NOEUD::get_x(void)
87     {
88     return xyz[0];
89     }
90    
91     double MG_NOEUD::get_y(void)
92     {
93     return xyz[1];
94     }
95    
96     double MG_NOEUD::get_z(void)
97     {
98     return xyz[2];
99     }
100    
101     double* MG_NOEUD::get_coord(void)
102     {
103     return xyz;
104     }
105 gervaislavoie 332
106    
107 francois 283 void MG_NOEUD::change_u(double uu)
108     {
109     u=uu;
110     }
111    
112     void MG_NOEUD::change_v(double vv)
113     {
114     v=vv;
115     }
116    
117     double MG_NOEUD::get_u(void)
118     {
119     return u;
120     }
121    
122     double MG_NOEUD::get_v(void)
123     {
124     return v;
125     }
126    
127     void MG_NOEUD::change_x(double xx)
128     {
129     xyz[0]=xx;
130     }
131    
132     void MG_NOEUD::change_y(double yy)
133     {
134     xyz[1]=yy;
135     }
136    
137     void MG_NOEUD::change_z(double zz)
138     {
139     xyz[2]=zz;
140     }
141    
142     void MG_NOEUD::change_coord(double *coo)
143     {
144     xyz[0]=coo[0];
145     xyz[1]=coo[1];
146     xyz[2]=coo[2];
147     }
148    
149    
150     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_segment(void)
151     {
152     return &segment;
153     }
154    
155    
156     TPL_LISTE_ENTITE<class MG_SEGMENT*>* MG_NOEUD::get_lien_petit_segment(void)
157     {
158     return &petit_segment;
159     }
160    
161    
162     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_triangle(void)
163     {
164     return &triangle;
165     }
166    
167    
168     TPL_LISTE_ENTITE<class MG_TRIANGLE*>* MG_NOEUD::get_lien_petit_triangle(void)
169     {
170     return &petit_triangle;
171     }
172    
173 francois 308 TPL_LISTE_ENTITE<class MG_QUADRANGLE*>* MG_NOEUD::get_lien_quadrangle(void)
174     {
175     return &quadrangle;
176     }
177    
178    
179     TPL_LISTE_ENTITE<class MG_QUADRANGLE*>* MG_NOEUD::get_lien_petit_quadrangle(void)
180     {
181     return &petit_quadrangle;
182     }
183    
184 francois 283 TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_tetra(void)
185     {
186     return &tetra;
187     }
188    
189    
190     TPL_LISTE_ENTITE<class MG_TETRA*>* MG_NOEUD::get_lien_petit_tetra(void)
191     {
192     return &petit_tetra;
193     }
194    
195 francois 308 TPL_LISTE_ENTITE<class MG_HEXA*>* MG_NOEUD::get_lien_hexa(void)
196     {
197     return &hexa;
198     }
199 francois 283
200    
201 francois 308 TPL_LISTE_ENTITE<class MG_HEXA*>* MG_NOEUD::get_lien_petit_hexa(void)
202     {
203     return &petit_hexa;
204     }
205    
206 francois 876 TPL_LISTE_ENTITE<class MG_PENTA*>* MG_NOEUD::get_lien_penta(void)
207     {
208     return &penta;
209     }
210 francois 308
211    
212 francois 876 TPL_LISTE_ENTITE<class MG_PENTA*>* MG_NOEUD::get_lien_petit_penta(void)
213     {
214     return &petit_penta;
215     }
216    
217    
218    
219 francois 283 int MG_NOEUD::get_dimension(void)
220     {
221     return 0;
222     }
223    
224    
225    
226    
227     BOITE_2D MG_NOEUD::get_boite_2D(double periodeu,double periodev)
228     {
229     BOITE_2D boite(u,v,u,v);
230     return boite;
231    
232     }
233    
234     BOITE_3D MG_NOEUD::get_boite_3D(void)
235     {
236     BOITE_3D boite(xyz[0],xyz[1],xyz[2],xyz[0],xyz[1],xyz[2]);
237     return boite;
238    
239     }
240    
241 francois 763 void MG_NOEUD::enregistrer(std::ostream& o,double version)
242 francois 283 {
243     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=NOEUD($"<< get_lien_topologie()->get_id() << "," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation << ");" << std::endl;
244     else o << "%" << get_id() << "=NOEUD(NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << origine_creation <<");" << std::endl;
245    
246     }
247