ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_quadrangle4.cpp
Revision: 763
Committed: Wed Dec 2 19:55:53 2015 UTC (9 years, 5 months ago) by francois
File size: 10162 byte(s)
Log Message:
Le fichier MAGiC est maintenant versionné. LA version actuelle est 2.0. L'ancienne version est 1.0.
Tout est transparent pour l'utilisateur. Les vieilles versions sont lisibles mais les nouveaux enregistrements sont dans la version la plus récente.
Changement des conditions aux limites : ajout d'un parametre pour dire si la condition numerique est une valeur ou une formule ou un lien vers une autre entité magic.
Les parametres pour saisir sont maintenant -ccf -ccfi -ccff -ccft -ccfit -ccfft

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    
136    
137    
138    
139     int FEM_QUADRANGLE4::get_type_entite(void)
140     {
141     return IDFEM_QUADRANGLE4;
142     }
143    
144     int FEM_QUADRANGLE4::get_dimension(void)
145     {
146     return 2;
147     }
148    
149    
150    
151     int FEM_QUADRANGLE4::get_nb_fem_noeud(void)
152     {
153     return FEM_TEMPLATE_ELEMENT<4>::get_nb_fem_noeud();
154     }
155    
156     FEM_NOEUD* FEM_QUADRANGLE4::get_fem_noeud(int num)
157     {
158     return FEM_TEMPLATE_ELEMENT<4>::get_fem_noeud(num);
159     }
160    
161     void FEM_QUADRANGLE4::change_noeud(int num,FEM_NOEUD* noeud)
162     {
163     FEM_TEMPLATE_ELEMENT<4>::change_noeud(num,noeud);
164     }
165    
166     BOITE_3D& FEM_QUADRANGLE4::get_boite_3D(void)
167     {
168     return FEM_TEMPLATE_ELEMENT<4>::get_boite_3D();
169     }
170    
171    
172 francois 763 void FEM_QUADRANGLE4::enregistrer(std::ostream& o,double version)
173 francois 310 {
174 francois 378 if (maillage!=NULL)
175     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;
176     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;
177     else
178     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;
179     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;
180    
181 francois 310 }
182 francois 637
183    
184     int FEM_QUADRANGLE4::get_nb_pt_gauss(int degre)
185     {
186 francois 755 return OT_POINTS_GAUSS::get_nb_point_quad_prod(degre);
187 francois 637 }
188    
189     void FEM_QUADRANGLE4::get_pt_gauss(int degre,int num,double &w,double *uv)
190     {
191 francois 755 return OT_POINTS_GAUSS::get_pt_gauss_qua_prod(degre,num,w,uv);
192 francois 637 }
193 francois 757
194    
195     int FEM_QUADRANGLE4::get_degre_gauss(int num)
196     {
197     return OT_POINTS_GAUSS::get_degre_gauss_quad_prod(num);
198     }
199    
200    
201 francois 638 int FEM_QUADRANGLE4::get_nb_fonction_interpolation(void)
202 francois 310 {
203     return 4;
204     }
205 francois 638 int FEM_QUADRANGLE4::get_degremax_fonction_interpolation(void)
206     {
207     return 2;
208     }
209 francois 310
210     double FEM_QUADRANGLE4::get_fonction_interpolation(int num,double *uv)
211     {
212     double val;
213     switch (num)
214     {
215     case 1:
216     val=0.25*(1-uv[0])*(1-uv[1]);
217     break;
218     case 2:
219     val=0.25*(1+uv[0])*(1-uv[1]);
220     break;
221     case 3:
222     val=0.25*(1+uv[0])*(1+uv[1]);
223     break;
224     case 4:
225     val=0.25*(1-uv[0])*(1+uv[1]);
226     break;
227     }
228     return val;
229     }
230    
231     double FEM_QUADRANGLE4::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
232     {
233     double val;
234    
235     switch (num)
236     {
237     case 1:
238     switch (num_variable)
239     {
240     case 1:
241     val=0.25*(-1+uv[1]);
242     break;
243     case 2:
244     val=0.25*(-1+uv[0]);
245     break;
246     } break;
247     case 2:
248     switch (num_variable)
249     {
250     case 1:
251     val=0.25*(1-uv[1]);
252     break;
253     case 2:
254     val=0.25*(-1-uv[0]);
255     break;
256     }break;
257     case 3:
258     switch (num_variable)
259     {
260     case 1:
261     val=0.25*(1+uv[1]);
262     break;
263     case 2:
264     val=0.25*(1+uv[0]);
265     break;
266     }break;
267     case 4:
268     switch (num_variable)
269     {
270     case 1:
271     val=0.25*(-1-uv[1]);
272     break;
273     case 2:
274     val=0.25*(1-uv[0]);
275     break;
276     }break;
277    
278     }
279     return val;
280     }
281    
282 francois 635 bool FEM_QUADRANGLE4::valide_parametre_EF(double* uvw)
283     {
284 francois 674 if (uvw[0]>=-1.-1e-10)
285     if (uvw[1]>=-1.-1e-10)
286 francois 635 if (uvw[0]<=1.+1e-10)
287     if (uvw[1]<=1.+1e-10)
288     return true;
289     return false;
290     }
291    
292 francois 684
293     void FEM_QUADRANGLE4::reinit_boite_3D(void)
294     {
295     FEM_TEMPLATE_ELEMENT<4>::reinit_boite_3D();
296     }
297    
298 francois 310 double FEM_QUADRANGLE4::get_jacobien(double* jac,double *uv,int& li,int& col,double unite)
299     {
300    
301     }
302    
303     void FEM_QUADRANGLE4::get_inverse_jacob(double* j,double *uv,double unite)
304     {
305    
306     }