ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/fem_quadrangle4.cpp
Revision: 755
Committed: Fri Oct 30 14:12:51 2015 UTC (9 years, 6 months ago) by francois
File size: 10035 byte(s)
Log Message:
pt gauss suite

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     void FEM_QUADRANGLE4::enregistrer(std::ostream& o)
173     {
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 638 int FEM_QUADRANGLE4::get_nb_fonction_interpolation(void)
194 francois 310 {
195     return 4;
196     }
197 francois 638 int FEM_QUADRANGLE4::get_degremax_fonction_interpolation(void)
198     {
199     return 2;
200     }
201 francois 310
202     double FEM_QUADRANGLE4::get_fonction_interpolation(int num,double *uv)
203     {
204     double val;
205     switch (num)
206     {
207     case 1:
208     val=0.25*(1-uv[0])*(1-uv[1]);
209     break;
210     case 2:
211     val=0.25*(1+uv[0])*(1-uv[1]);
212     break;
213     case 3:
214     val=0.25*(1+uv[0])*(1+uv[1]);
215     break;
216     case 4:
217     val=0.25*(1-uv[0])*(1+uv[1]);
218     break;
219     }
220     return val;
221     }
222    
223     double FEM_QUADRANGLE4::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
224     {
225     double val;
226    
227     switch (num)
228     {
229     case 1:
230     switch (num_variable)
231     {
232     case 1:
233     val=0.25*(-1+uv[1]);
234     break;
235     case 2:
236     val=0.25*(-1+uv[0]);
237     break;
238     } break;
239     case 2:
240     switch (num_variable)
241     {
242     case 1:
243     val=0.25*(1-uv[1]);
244     break;
245     case 2:
246     val=0.25*(-1-uv[0]);
247     break;
248     }break;
249     case 3:
250     switch (num_variable)
251     {
252     case 1:
253     val=0.25*(1+uv[1]);
254     break;
255     case 2:
256     val=0.25*(1+uv[0]);
257     break;
258     }break;
259     case 4:
260     switch (num_variable)
261     {
262     case 1:
263     val=0.25*(-1-uv[1]);
264     break;
265     case 2:
266     val=0.25*(1-uv[0]);
267     break;
268     }break;
269    
270     }
271     return val;
272     }
273    
274 francois 635 bool FEM_QUADRANGLE4::valide_parametre_EF(double* uvw)
275     {
276 francois 674 if (uvw[0]>=-1.-1e-10)
277     if (uvw[1]>=-1.-1e-10)
278 francois 635 if (uvw[0]<=1.+1e-10)
279     if (uvw[1]<=1.+1e-10)
280     return true;
281     return false;
282     }
283    
284 francois 684
285     void FEM_QUADRANGLE4::reinit_boite_3D(void)
286     {
287     FEM_TEMPLATE_ELEMENT<4>::reinit_boite_3D();
288     }
289    
290 francois 310 double FEM_QUADRANGLE4::get_jacobien(double* jac,double *uv,int& li,int& col,double unite)
291     {
292    
293     }
294    
295     void FEM_QUADRANGLE4::get_inverse_jacob(double* j,double *uv,double unite)
296     {
297    
298     }