ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_quadrangle4.cpp
Revision: 786
Committed: Wed Mar 9 21:10:49 2016 UTC (9 years, 2 months ago) by francois
File size: 10646 byte(s)
Log Message:
Possibilité d'obtenir la matrice de rigidite de code aster sous form de matrice bande.
Pour cela ajouter -opt dans l'operation -fem à la création du maillage FEM et dans -calculaster utiliser les nouveaux types d'étude rigidite.
Attention pour cela il faut une version de code aster modifiée
De manière automatique elle peut etre optenu en faisant ./instal_aster 12.5mod
Uniquement implantée avec la version 12.5 de code aster. 

File Contents

# User Rev Content
1 francois 310 //------------------------------------------------------------
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_triangle3.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_quadrangle4.h"
27     #include "fem_maillage.h"
28     #include "fem_noeud.h"
29     #include "mg_element_maillage.h"
30 francois 754 #include "ot_quadrature_gauss.h"
31 francois 310
32    
33     FEM_QUADRANGLE4::FEM_QUADRANGLE4(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT2(num,mai),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
34     {
35     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
36     tab[0]->get_lien_element2()->ajouter(this);
37     tab[1]->get_lien_element2()->ajouter(this);
38     tab[2]->get_lien_element2()->ajouter(this);
39     tab[3]->get_lien_element2()->ajouter(this);
40     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
41     }
42    
43     FEM_QUADRANGLE4::FEM_QUADRANGLE4(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT2(mai),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
44     {
45     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
46     tab[0]->get_lien_element2()->ajouter(this);
47     tab[1]->get_lien_element2()->ajouter(this);
48     tab[2]->get_lien_element2()->ajouter(this);
49     tab[3]->get_lien_element2()->ajouter(this);
50     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
51     }
52    
53 francois 378 FEM_QUADRANGLE4::FEM_QUADRANGLE4(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class FEM_NOEUD** tabnoeud):FEM_ELEMENT2(num,topo),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
54     {
55     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
56     tab[0]->get_lien_element2()->ajouter(this);
57     tab[1]->get_lien_element2()->ajouter(this);
58     tab[2]->get_lien_element2()->ajouter(this);
59     tab[3]->get_lien_element2()->ajouter(this);
60     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
61     }
62    
63     FEM_QUADRANGLE4::FEM_QUADRANGLE4(class MG_ELEMENT_TOPOLOGIQUE* topo,FEM_NOEUD** tabnoeud):FEM_ELEMENT2(topo),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
64     {
65     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
66     tab[0]->get_lien_element2()->ajouter(this);
67     tab[1]->get_lien_element2()->ajouter(this);
68     tab[2]->get_lien_element2()->ajouter(this);
69     tab[3]->get_lien_element2()->ajouter(this);
70     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
71     }
72     FEM_QUADRANGLE4::FEM_QUADRANGLE4(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT2(num,topo,mai),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
73     {
74     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
75     tab[0]->get_lien_element2()->ajouter(this);
76     tab[1]->get_lien_element2()->ajouter(this);
77     tab[2]->get_lien_element2()->ajouter(this);
78     tab[3]->get_lien_element2()->ajouter(this);
79     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
80     }
81    
82     FEM_QUADRANGLE4::FEM_QUADRANGLE4(class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT2(topo,mai),FEM_TEMPLATE_ELEMENT<4>(tabnoeud)
83     {
84     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
85     tab[0]->get_lien_element2()->ajouter(this);
86     tab[1]->get_lien_element2()->ajouter(this);
87     tab[2]->get_lien_element2()->ajouter(this);
88     tab[3]->get_lien_element2()->ajouter(this);
89     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
90     }
91    
92    
93    
94    
95    
96    
97    
98    
99    
100    
101    
102 francois 310 FEM_QUADRANGLE4::FEM_QUADRANGLE4(FEM_QUADRANGLE4& mdd):FEM_ELEMENT2(mdd),FEM_TEMPLATE_ELEMENT<4>(mdd)
103     {
104     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==2) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
105     tab[0]->get_lien_element2()->ajouter(this);
106     tab[1]->get_lien_element2()->ajouter(this);
107     tab[2]->get_lien_element2()->ajouter(this);
108     tab[3]->get_lien_element2()->ajouter(this);
109     get_fem_noeudpetitid()->get_lien_petit_element2()->ajouter(this);
110     }
111     FEM_QUADRANGLE4::~FEM_QUADRANGLE4()
112     {
113 francois 663 if (liaison_topologique!=NULL)
114     if (liaison_topologique->get_dimension()==0) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
115 francois 310 tab[0]->get_lien_element2()->supprimer(this);
116     tab[1]->get_lien_element2()->supprimer(this);
117     tab[2]->get_lien_element2()->supprimer(this);
118     tab[3]->get_lien_element2()->supprimer(this);
119     get_fem_noeudpetitid()->get_lien_petit_element2()->supprimer(this);
120     }
121    
122    
123     FEM_ELEMENT_MAILLAGE* FEM_QUADRANGLE4::dupliquer(FEM_MAILLAGE *femmai,long decalage)
124     {
125     FEM_NOEUD* tabnoeud[4];
126     tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage);
127     tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage);
128     tabnoeud[2]=femmai->get_fem_noeudid(tab[2]->get_id()+decalage);
129     tabnoeud[3]=femmai->get_fem_noeudid(tab[3]->get_id()+decalage);
130     FEM_QUADRANGLE4* quad=new FEM_QUADRANGLE4(get_id()+decalage,maillage,tabnoeud);
131     femmai->ajouter_fem_element2(quad);
132     return quad;
133     }
134    
135 francois 786 void FEM_QUADRANGLE4::get_voisin_noeud(class FEM_NOEUD* no,TPL_LISTE_ENTITE<FEM_NOEUD*> &voisin)
136     {
137     voisin.vide();
138     if (no==tab[0])
139     {
140     voisin.ajouter(tab[1]);
141     voisin.ajouter(tab[3]);
142     }
143     if (no==tab[1])
144     {
145     voisin.ajouter(tab[0]);
146     voisin.ajouter(tab[2]);
147     }
148     if (no==tab[2])
149     {
150     voisin.ajouter(tab[1]);
151     voisin.ajouter(tab[3]);
152     }
153     if (no==tab[3])
154     {
155     voisin.ajouter(tab[0]);
156     voisin.ajouter(tab[2]);
157     }
158     }
159 francois 310
160    
161    
162    
163     int FEM_QUADRANGLE4::get_type_entite(void)
164     {
165     return IDFEM_QUADRANGLE4;
166     }
167    
168     int FEM_QUADRANGLE4::get_dimension(void)
169     {
170     return 2;
171     }
172    
173    
174    
175     int FEM_QUADRANGLE4::get_nb_fem_noeud(void)
176     {
177     return FEM_TEMPLATE_ELEMENT<4>::get_nb_fem_noeud();
178     }
179    
180     FEM_NOEUD* FEM_QUADRANGLE4::get_fem_noeud(int num)
181     {
182     return FEM_TEMPLATE_ELEMENT<4>::get_fem_noeud(num);
183     }
184    
185     void FEM_QUADRANGLE4::change_noeud(int num,FEM_NOEUD* noeud)
186     {
187     FEM_TEMPLATE_ELEMENT<4>::change_noeud(num,noeud);
188     }
189    
190     BOITE_3D& FEM_QUADRANGLE4::get_boite_3D(void)
191     {
192     return FEM_TEMPLATE_ELEMENT<4>::get_boite_3D();
193     }
194    
195    
196 francois 763 void FEM_QUADRANGLE4::enregistrer(std::ostream& o,double version)
197 francois 310 {
198 francois 378 if (maillage!=NULL)
199     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_QUADRANGLE4($"<< get_lien_topologie()->get_id() << ",$" << maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id()<< ");" << std::endl;
200     else o << "%" << get_id() << "=FEM_QUADRANGLE4(NULL,$" << maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id()<< ");" << std::endl;
201     else
202     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_QUADRANGLE4($"<< get_lien_topologie()->get_id() << ",NULL,$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id()<< ");" << std::endl;
203     else o << "%" << get_id() << "=FEM_QUADRANGLE4(NULL,NULL,$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id()<< ");" << std::endl;
204    
205 francois 310 }
206 francois 637
207    
208     int FEM_QUADRANGLE4::get_nb_pt_gauss(int degre)
209     {
210 francois 755 return OT_POINTS_GAUSS::get_nb_point_quad_prod(degre);
211 francois 637 }
212    
213     void FEM_QUADRANGLE4::get_pt_gauss(int degre,int num,double &w,double *uv)
214     {
215 francois 755 return OT_POINTS_GAUSS::get_pt_gauss_qua_prod(degre,num,w,uv);
216 francois 637 }
217 francois 757
218    
219     int FEM_QUADRANGLE4::get_degre_gauss(int num)
220     {
221     return OT_POINTS_GAUSS::get_degre_gauss_quad_prod(num);
222     }
223    
224    
225 francois 638 int FEM_QUADRANGLE4::get_nb_fonction_interpolation(void)
226 francois 310 {
227     return 4;
228     }
229 francois 638 int FEM_QUADRANGLE4::get_degremax_fonction_interpolation(void)
230     {
231     return 2;
232     }
233 francois 310
234     double FEM_QUADRANGLE4::get_fonction_interpolation(int num,double *uv)
235     {
236     double val;
237     switch (num)
238     {
239     case 1:
240     val=0.25*(1-uv[0])*(1-uv[1]);
241     break;
242     case 2:
243     val=0.25*(1+uv[0])*(1-uv[1]);
244     break;
245     case 3:
246     val=0.25*(1+uv[0])*(1+uv[1]);
247     break;
248     case 4:
249     val=0.25*(1-uv[0])*(1+uv[1]);
250     break;
251     }
252     return val;
253     }
254    
255     double FEM_QUADRANGLE4::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
256     {
257     double val;
258    
259     switch (num)
260     {
261     case 1:
262     switch (num_variable)
263     {
264     case 1:
265     val=0.25*(-1+uv[1]);
266     break;
267     case 2:
268     val=0.25*(-1+uv[0]);
269     break;
270     } break;
271     case 2:
272     switch (num_variable)
273     {
274     case 1:
275     val=0.25*(1-uv[1]);
276     break;
277     case 2:
278     val=0.25*(-1-uv[0]);
279     break;
280     }break;
281     case 3:
282     switch (num_variable)
283     {
284     case 1:
285     val=0.25*(1+uv[1]);
286     break;
287     case 2:
288     val=0.25*(1+uv[0]);
289     break;
290     }break;
291     case 4:
292     switch (num_variable)
293     {
294     case 1:
295     val=0.25*(-1-uv[1]);
296     break;
297     case 2:
298     val=0.25*(1-uv[0]);
299     break;
300     }break;
301    
302     }
303     return val;
304     }
305    
306 francois 635 bool FEM_QUADRANGLE4::valide_parametre_EF(double* uvw)
307     {
308 francois 674 if (uvw[0]>=-1.-1e-10)
309     if (uvw[1]>=-1.-1e-10)
310 francois 635 if (uvw[0]<=1.+1e-10)
311     if (uvw[1]<=1.+1e-10)
312     return true;
313     return false;
314     }
315    
316 francois 684
317     void FEM_QUADRANGLE4::reinit_boite_3D(void)
318     {
319     FEM_TEMPLATE_ELEMENT<4>::reinit_boite_3D();
320     }
321    
322 francois 310 double FEM_QUADRANGLE4::get_jacobien(double* jac,double *uv,int& li,int& col,double unite)
323     {
324    
325     }
326    
327     void FEM_QUADRANGLE4::get_inverse_jacob(double* j,double *uv,double unite)
328     {
329    
330     }