ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_noeud.cpp
Revision: 883
Committed: Thu Apr 20 13:38:18 2017 UTC (8 years, 4 months ago) by francois
File size: 11750 byte(s)
Log Message:
Creation d'un mailleur FEM pour pouvoir avoir des stratégies paramétrées de maillage. L'ancienne méthode construit disparait et est remplacée par l'utilisation d'un MAILLEUR_FEM.
Stratégie de quadratisation mise en place : déplacer les noeuds pour s'assurer que les tetras quadratiques présentent une distortion au dessu d'une borne inférieure. Mais ces noeuds quittent la géométrie.

Les paramètres dans ~/.magic.

File Contents

# Content
1 //------------------------------------------------------------
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 // fem_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 "fem_noeud.h"
27 #include "fem_maillage.h"
28 #include "mg_noeud.h"
29
30
31
32
33
34 FEM_NOEUD::FEM_NOEUD(MG_NOEUD* noeud):FEM_ELEMENT_MAILLAGE(noeud),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
35 {
36 xyz[0]=noeud->get_x();
37 xyz[1]=noeud->get_y();
38 xyz[2]=noeud->get_z();
39 xyzorigine[0]=noeud->get_x();
40 xyzorigine[1]=noeud->get_y();
41 xyzorigine[2]=noeud->get_z();
42 dxyz[0]=0.;
43 dxyz[1]=0.;
44 dxyz[2]=0.;
45 rxyz[0]=0.;
46 rxyz[1]=0.;
47 rxyz[2]=0.;
48 if (liaison_topologique==NULL) return;
49 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
50 }
51
52 FEM_NOEUD::FEM_NOEUD(unsigned long num,MG_NOEUD* noeud):FEM_ELEMENT_MAILLAGE(num,noeud),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
53 {
54 xyz[0]=noeud->get_x();
55 xyz[1]=noeud->get_y();
56 xyz[2]=noeud->get_z();
57 xyzorigine[0]=noeud->get_x();
58 xyzorigine[1]=noeud->get_y();
59 xyzorigine[2]=noeud->get_z();
60 dxyz[0]=0.;
61 dxyz[1]=0.;
62 dxyz[2]=0.;
63 rxyz[0]=0.;
64 rxyz[1]=0.;
65 rxyz[2]=0.;
66 if (liaison_topologique==NULL) return;
67 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
68 }
69
70 FEM_NOEUD::FEM_NOEUD(MG_ELEMENT_MAILLAGE* mai,double x,double y,double z,double xori,double yori,double zori):FEM_ELEMENT_MAILLAGE(mai),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
71 {
72 xyz[0]=x;
73 xyz[1]=y;
74 xyz[2]=z;
75 xyzorigine[0]=xori;
76 xyzorigine[1]=yori;
77 xyzorigine[2]=zori;
78 dxyz[0]=0.;
79 dxyz[1]=0.;
80 dxyz[2]=0.;
81 rxyz[0]=0.;
82 rxyz[1]=0.;
83 rxyz[2]=0.;
84 if (liaison_topologique==NULL) return;
85 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
86 }
87
88 FEM_NOEUD* FEM_NOEUD::dupliquer(FEM_MAILLAGE *femmai,long decalage)
89 {
90 FEM_NOEUD* noeud=new FEM_NOEUD(this->get_id()+decalage,liaison_topologique,xyz[0],xyz[1],xyz[2]);
91 femmai->ajouter_fem_noeud(noeud);
92 return noeud;
93 }
94 void FEM_NOEUD::reinit_boite_3D(void)
95 {
96 }
97
98
99 void FEM_NOEUD::reinit_boite_element_3D(void)
100 {
101 for (int i=0;i<get_lien_element3()->get_nb();i++)
102 get_lien_element3()->get(i)->reinit_boite_3D();
103 for (int i=0;i<get_lien_element2()->get_nb();i++)
104 get_lien_element2()->get(i)->reinit_boite_3D();
105 for (int i=0;i<get_lien_element1()->get_nb();i++)
106 get_lien_element1()->get(i)->reinit_boite_3D();
107 }
108
109 FEM_NOEUD::FEM_NOEUD(unsigned long num,MG_ELEMENT_TOPOLOGIQUE* topo,double x,double y,double z,double xori,double yori,double zori):FEM_ELEMENT_MAILLAGE(num,topo),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
110 {
111 xyz[0]=x;
112 xyz[1]=y;
113 xyz[2]=z;
114 xyzorigine[0]=xori;
115 xyzorigine[1]=yori;
116 xyzorigine[2]=zori;
117 dxyz[0]=0.;
118 dxyz[1]=0.;
119 dxyz[2]=0.;
120 rxyz[0]=0.;
121 rxyz[1]=0.;
122 rxyz[2]=0.;
123 if (liaison_topologique==NULL) return;
124 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
125 }
126
127 FEM_NOEUD::FEM_NOEUD(MG_ELEMENT_TOPOLOGIQUE* topo,double x,double y,double z,double xori,double yori,double zori):FEM_ELEMENT_MAILLAGE(topo),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
128 {
129 xyz[0]=x;
130 xyz[1]=y;
131 xyz[2]=z;
132 xyzorigine[0]=xori;
133 xyzorigine[1]=yori;
134 xyzorigine[2]=zori;
135 dxyz[0]=0.;
136 dxyz[1]=0.;
137 dxyz[2]=0.;
138 rxyz[0]=0.;
139 rxyz[1]=0.;
140 rxyz[2]=0.;
141 if (liaison_topologique==NULL) return;
142 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
143 }
144
145 FEM_NOEUD::FEM_NOEUD(unsigned long num,MG_ELEMENT_MAILLAGE* mai,double x,double y,double z,double xori,double yori,double zori):FEM_ELEMENT_MAILLAGE(num,mai),numero(-1),numero_opt(-1),activedeplacement1(0),activedeplacement2(0),activedeplacement3(0),activereaction1(0),activereaction2(0),activereaction3(0)
146 {
147 xyz[0]=x;
148 xyz[1]=y;
149 xyz[2]=z;
150 xyzorigine[0]=xori;
151 xyzorigine[1]=yori;
152 xyzorigine[2]=zori;
153 dxyz[0]=0.;
154 dxyz[1]=0.;
155 dxyz[2]=0.;
156 rxyz[0]=0.;
157 rxyz[1]=0.;
158 rxyz[2]=0.;
159 if (liaison_topologique==NULL) return;
160 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
161 }
162
163
164
165 FEM_NOEUD::FEM_NOEUD(FEM_NOEUD& mdd):FEM_ELEMENT_MAILLAGE(mdd),numero(-1),numero_opt(-1),activedeplacement1(mdd.activedeplacement1),activedeplacement2(mdd.activedeplacement2),activedeplacement3(mdd.activedeplacement3),activereaction1(mdd.activereaction1),activereaction2(mdd.activereaction2),activereaction3(mdd.activereaction3)
166 {
167 xyz[0]=mdd.xyz[0];
168 xyz[1]=mdd.xyz[1];
169 xyz[2]=mdd.xyz[2];
170 xyzorigine[0]=mdd.xyzorigine[0];
171 xyzorigine[1]=mdd.xyzorigine[1];
172 xyzorigine[2]=mdd.xyzorigine[2];
173 dxyz[0]=mdd.dxyz[0];
174 dxyz[1]=mdd.dxyz[1];
175 dxyz[2]=mdd.dxyz[2];
176 rxyz[0]=mdd.rxyz[0];
177 rxyz[1]=mdd.rxyz[1];
178 rxyz[2]=mdd.rxyz[2];
179 if (liaison_topologique==NULL) return;
180 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
181 }
182
183 FEM_NOEUD::~FEM_NOEUD()
184 {
185 if (liaison_topologique==NULL) return;
186 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
187 }
188 void FEM_NOEUD::get_voisin_noeud(class FEM_NOEUD* no,TPL_LISTE_ENTITE<FEM_NOEUD*> &voisin)
189 {
190 voisin.vide();
191 }
192
193 void FEM_NOEUD::change_topologie_null(MG_ELEMENT_TOPOLOGIQUE* ele)
194 {
195 if (liaison_topologique!=NULL) return;
196 liaison_topologique=ele;
197 if (liaison_topologique==NULL) return;
198 if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
199 }
200
201 int FEM_NOEUD::get_type_entite(void)
202 {
203 return IDFEM_NOEUD;
204 }
205
206 double FEM_NOEUD::get_x(double coef)
207 {
208 return xyz[0]+coef*dxyz[0];
209 }
210
211 double FEM_NOEUD::get_y(double coef)
212 {
213 return xyz[1]+coef*dxyz[1];
214 }
215
216 double FEM_NOEUD::get_z(double coef)
217 {
218 return xyz[2]+coef*dxyz[2];
219 }
220
221 double FEM_NOEUD::get_dx(double coef)
222 {
223 return dxyz[0]*coef;
224 }
225
226 double FEM_NOEUD::get_dy(double coef)
227 {
228 return dxyz[1]*coef;
229 }
230
231 double FEM_NOEUD::get_dz(double coef)
232 {
233 return dxyz[2]*coef;
234 }
235
236
237
238 double FEM_NOEUD::get_rx(void)
239 {
240 return rxyz[0];
241 }
242 double FEM_NOEUD::get_ry(void)
243 {
244 return rxyz[1];
245 }
246
247 double FEM_NOEUD::get_rz(void)
248 {
249 return rxyz[2];
250 }
251
252
253
254
255 double* FEM_NOEUD::get_coord(void)
256 {
257 return xyz;
258 }
259
260 double* FEM_NOEUD::get_coord_ori(void)
261 {
262 return xyzorigine;
263 }
264
265
266 void FEM_NOEUD::change_x(double xx)
267 {
268 xyz[0]=xx;
269 reinit_boite_element_3D();
270
271 }
272
273 void FEM_NOEUD::change_y(double yy)
274 {
275 xyz[1]=yy;
276 reinit_boite_element_3D();
277 }
278
279 void FEM_NOEUD::change_z(double zz)
280 {
281 xyz[2]=zz;
282 reinit_boite_element_3D();
283 }
284 void FEM_NOEUD::change_rx(double xx)
285 {
286 rxyz[0]=xx;
287 activereaction1=1;
288 }
289
290 void FEM_NOEUD::change_ry(double yy)
291 {
292 rxyz[1]=yy;
293 activereaction2=1;
294 }
295
296 void FEM_NOEUD::change_rz(double zz)
297 {
298 rxyz[2]=zz;
299 activereaction3=1;
300
301 }
302
303 void FEM_NOEUD::change_dx(double xx)
304 {
305 dxyz[0]=xx;
306 activedeplacement1=1;
307 }
308
309 void FEM_NOEUD::change_dy(double yy)
310 {
311 dxyz[1]=yy;
312 activedeplacement2=1;
313 }
314
315 void FEM_NOEUD::change_dz(double zz)
316 {
317 dxyz[2]=zz;
318 activedeplacement3=1;
319 }
320
321 void FEM_NOEUD::change_coord(double *coo)
322 {
323 xyz[0]=coo[0];
324 xyz[1]=coo[1];
325 xyz[2]=coo[2];
326 reinit_boite_element_3D();
327 }
328
329 int FEM_NOEUD::get_numero(void)
330 {
331 return numero;
332 }
333
334 void FEM_NOEUD::change_numero(int num)
335 {
336 numero=num;
337 }
338
339 int FEM_NOEUD::get_numero_opt(void)
340 {
341 return numero_opt;
342 }
343
344 void FEM_NOEUD::change_numero_opt(int num)
345 {
346 numero_opt=num;
347 }
348
349 bool FEM_NOEUD::valide_parametre_EF(double *uvw)
350 {
351 return true;
352 }
353
354 int FEM_NOEUD::get_dimension(void)
355 {
356 return 0;
357 }
358
359 void FEM_NOEUD::change_solution(double val,int num)
360 {
361 solution[num]=val;
362 }
363
364
365 double FEM_NOEUD::get_solution(int num)
366 {
367 return solution[num];
368 }
369
370 BOITE_3D FEM_NOEUD::get_boite_3D(void)
371 {
372 BOITE_3D boite(xyz[0],xyz[1],xyz[2],xyz[0],xyz[1],xyz[2]);
373 return boite;
374
375 }
376
377 void FEM_NOEUD::enregistrer(std::ostream& o,double version)
378 {
379 if ((get_mg_element_maillage()!=NULL) && (get_lien_topologie()!=NULL)) o << "%" << get_id() << "=FEM_NOEUD($"<< get_lien_topologie()->get_id() << ",$" << maillage->get_id() << "," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << numero << "," << numero_opt << ");" << std::endl;
380 else if ((get_mg_element_maillage()!=NULL) && (get_lien_topologie()==NULL)) o << "%" << get_id() << "=FEM_NOEUD(NULL,$" << maillage->get_id() << "," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << numero << "," << numero_opt << ");" << std::endl;
381 else if ((get_mg_element_maillage()==NULL) && (get_lien_topologie()!=NULL)) o << "%" << get_id() << "=FEM_NOEUD($" << get_lien_topologie()->get_id() << ",NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << numero << "," << numero_opt << ");" << std::endl;
382 else o << "%" << get_id() << "=FEM_NOEUD(NULL,NULL," << xyz[0] << "," << xyz[1] << "," << xyz[2] << "," << numero << "," << numero_opt << ");" << std::endl;
383 if (activereaction1==1)
384 if (activereaction2==1)
385 if (activereaction3==1)
386 o << "%" << get_id() << "=FEM_NOEUD_REAC(" << rxyz[0] << "," << rxyz[1] << "," << rxyz[2] << ");" << std::endl;
387 if (activedeplacement1==1)
388 if (activedeplacement2==1)
389 if (activedeplacement3==1)
390 o << "%" << get_id() << "=FEM_NOEUD_DEF(" << dxyz[0] << "," << dxyz[1] << "," << dxyz[2] << ");" << std::endl;
391 }
392
393
394
395 TPL_LISTE_ENTITE<class FEM_ELEMENT1*>* FEM_NOEUD::get_lien_element1(void)
396 {
397 return &element1;
398 }
399
400
401 TPL_LISTE_ENTITE<class FEM_ELEMENT1*>* FEM_NOEUD::get_lien_petit_element1(void)
402 {
403 return &petit_element1;
404 }
405
406
407 TPL_LISTE_ENTITE<class FEM_ELEMENT2*>* FEM_NOEUD::get_lien_element2(void)
408 {
409 return &element2;
410 }
411
412
413 TPL_LISTE_ENTITE<class FEM_ELEMENT2*>* FEM_NOEUD::get_lien_petit_element2(void)
414 {
415 return &petit_element2;
416 }
417
418 TPL_LISTE_ENTITE<class FEM_ELEMENT3*>* FEM_NOEUD::get_lien_element3(void)
419 {
420 return &element3;
421 }
422
423
424 TPL_LISTE_ENTITE<class FEM_ELEMENT3*>* FEM_NOEUD::get_lien_petit_element3(void)
425 {
426 return &petit_element3;
427 }
428 /*
429 int FEM_NOEUD::get_etat(void)
430 {
431 return etat;
432 }
433 void FEM_NOEUD::change_etat(int num)
434 {
435 etat=num;
436 }
437 */