ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mtu/src/fem_penta6.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months, 1 week ago) by francois
File size: 12804 byte(s)
Log Message:
compatibilité Ubuntu 22.04
Suppression des refeences à Windows
Ajout d'une banière

File Contents

# User Rev Content
1 francois 1158 //####//------------------------------------------------------------
2     //####//------------------------------------------------------------
3     //####// MAGiC
4     //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5     //####// Departement de Genie Mecanique - UQTR
6     //####//------------------------------------------------------------
7     //####// MAGIC est un projet de recherche de l equipe ERICCA
8     //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9     //####// http://www.uqtr.ca/ericca
10     //####// http://www.uqtr.ca/
11     //####//------------------------------------------------------------
12     //####//------------------------------------------------------------
13     //####//
14     //####// fem_penta6.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:55 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 francois 876
23    
24     #include "gestionversion.h"
25     #include "fem_penta6.h"
26     #include "fem_maillage.h"
27     #include "fem_noeud.h"
28     #include "mg_element_maillage.h"
29     #include "ot_tenseur.h"
30     #include "ot_quadrature_gauss.h"
31    
32    
33     FEM_PENTA6::FEM_PENTA6(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,mai),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
34     {
35     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
36     tab[0]->get_lien_element3()->ajouter(this);
37     tab[1]->get_lien_element3()->ajouter(this);
38     tab[2]->get_lien_element3()->ajouter(this);
39     tab[3]->get_lien_element3()->ajouter(this);
40     tab[4]->get_lien_element3()->ajouter(this);
41     tab[5]->get_lien_element3()->ajouter(this);
42     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
43     }
44    
45     FEM_PENTA6::FEM_PENTA6(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(mai),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
46     {
47     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
48     tab[0]->get_lien_element3()->ajouter(this);
49     tab[1]->get_lien_element3()->ajouter(this);
50     tab[2]->get_lien_element3()->ajouter(this);
51     tab[3]->get_lien_element3()->ajouter(this);
52     tab[4]->get_lien_element3()->ajouter(this);
53     tab[5]->get_lien_element3()->ajouter(this);
54     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
55     }
56    
57     FEM_PENTA6::FEM_PENTA6(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,topo),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
58     {
59     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
60     tab[0]->get_lien_element3()->ajouter(this);
61     tab[1]->get_lien_element3()->ajouter(this);
62     tab[2]->get_lien_element3()->ajouter(this);
63     tab[3]->get_lien_element3()->ajouter(this);
64     tab[4]->get_lien_element3()->ajouter(this);
65     tab[5]->get_lien_element3()->ajouter(this);
66     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
67     }
68    
69     FEM_PENTA6::FEM_PENTA6(class MG_ELEMENT_TOPOLOGIQUE* topo,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
70     {
71     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
72     tab[0]->get_lien_element3()->ajouter(this);
73     tab[1]->get_lien_element3()->ajouter(this);
74     tab[2]->get_lien_element3()->ajouter(this);
75     tab[3]->get_lien_element3()->ajouter(this);
76     tab[4]->get_lien_element3()->ajouter(this);
77     tab[5]->get_lien_element3()->ajouter(this);
78     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
79     }
80    
81     FEM_PENTA6::FEM_PENTA6(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,topo,mai),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
82     {
83     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
84     tab[0]->get_lien_element3()->ajouter(this);
85     tab[1]->get_lien_element3()->ajouter(this);
86     tab[2]->get_lien_element3()->ajouter(this);
87     tab[3]->get_lien_element3()->ajouter(this);
88     tab[4]->get_lien_element3()->ajouter(this);
89     tab[5]->get_lien_element3()->ajouter(this);
90     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
91     }
92    
93     FEM_PENTA6::FEM_PENTA6(class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo,mai),FEM_TEMPLATE_ELEMENT<6>(tabnoeud)
94     {
95     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
96     tab[0]->get_lien_element3()->ajouter(this);
97     tab[1]->get_lien_element3()->ajouter(this);
98     tab[2]->get_lien_element3()->ajouter(this);
99     tab[3]->get_lien_element3()->ajouter(this);
100     tab[4]->get_lien_element3()->ajouter(this);
101     tab[5]->get_lien_element3()->ajouter(this);
102     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
103     }
104    
105    
106    
107    
108     FEM_PENTA6::FEM_PENTA6(FEM_PENTA6& mdd):FEM_ELEMENT3(mdd),FEM_TEMPLATE_ELEMENT<6>(mdd)
109     {
110     if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
111     tab[0]->get_lien_element3()->ajouter(this);
112     tab[1]->get_lien_element3()->ajouter(this);
113     tab[2]->get_lien_element3()->ajouter(this);
114     tab[3]->get_lien_element3()->ajouter(this);
115     tab[4]->get_lien_element3()->ajouter(this);
116     tab[5]->get_lien_element3()->ajouter(this);
117     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
118     }
119     FEM_PENTA6::~FEM_PENTA6()
120     {
121     if (liaison_topologique!=NULL)
122     if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
123     tab[0]->get_lien_element3()->supprimer(this);
124     tab[1]->get_lien_element3()->supprimer(this);
125     tab[2]->get_lien_element3()->supprimer(this);
126     tab[3]->get_lien_element3()->supprimer(this);
127     tab[4]->get_lien_element3()->supprimer(this);
128     tab[5]->get_lien_element3()->supprimer(this);
129     get_fem_noeudpetitid()->get_lien_petit_element3()->supprimer(this);
130     }
131    
132    
133     FEM_ELEMENT_MAILLAGE* FEM_PENTA6::dupliquer(FEM_MAILLAGE *femmai,long decalage)
134     {
135     FEM_NOEUD* tabnoeud[8];
136     tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage);
137     tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage);
138     tabnoeud[2]=femmai->get_fem_noeudid(tab[2]->get_id()+decalage);
139     tabnoeud[3]=femmai->get_fem_noeudid(tab[3]->get_id()+decalage);
140     tabnoeud[4]=femmai->get_fem_noeudid(tab[4]->get_id()+decalage);
141     tabnoeud[5]=femmai->get_fem_noeudid(tab[5]->get_id()+decalage);
142     FEM_PENTA6* pen=new FEM_PENTA6(get_id()+decalage,maillage,tabnoeud);
143     femmai->ajouter_fem_element3(pen);
144     return pen;
145     }
146    
147     void FEM_PENTA6::get_voisin_noeud(class FEM_NOEUD* no,TPL_LISTE_ENTITE<FEM_NOEUD*> &voisin)
148     {
149     voisin.vide();
150     if (no==tab[0])
151     {
152     voisin.ajouter(tab[1]);
153     voisin.ajouter(tab[2]);
154     voisin.ajouter(tab[3]);
155     }
156     if (no==tab[1])
157     {
158     voisin.ajouter(tab[0]);
159     voisin.ajouter(tab[2]);
160     voisin.ajouter(tab[4]);
161     }
162     if (no==tab[2])
163     {
164     voisin.ajouter(tab[0]);
165     voisin.ajouter(tab[1]);
166     voisin.ajouter(tab[5]);
167     }
168     if (no==tab[3])
169     {
170     voisin.ajouter(tab[0]);
171     voisin.ajouter(tab[4]);
172     voisin.ajouter(tab[5]);
173     }
174     if (no==tab[4])
175     {
176     voisin.ajouter(tab[1]);
177     voisin.ajouter(tab[3]);
178     voisin.ajouter(tab[5]);
179     }
180     if (no==tab[5])
181     {
182     voisin.ajouter(tab[2]);
183     voisin.ajouter(tab[3]);
184     voisin.ajouter(tab[4]);
185     }
186     }
187    
188     bool FEM_PENTA6::valide_parametre_EF(double* uvw)
189     {
190     if (uvw[0]>=-1e-10)
191     if (uvw[1]>=-1e-10)
192     if (uvw[2]>=-1.-1e-10)
193     if (1.-uvw[0]-uvw[1]<=1.+1e-10)
194     if (uvw[2]<=1.+1e-10)
195     return true;
196     return false;
197     }
198    
199     void FEM_PENTA6::reinit_boite_3D(void)
200     {
201     FEM_TEMPLATE_ELEMENT<6>::reinit_boite_3D();
202     }
203    
204     int FEM_PENTA6::get_type_entite(void)
205     {
206 francois 1150 return MAGIC::TYPE_ENTITE::IDFEM_PENTA6;
207 francois 876 }
208    
209     int FEM_PENTA6::get_dimension(void)
210     {
211     return 3;
212     }
213    
214    
215    
216     int FEM_PENTA6::get_nb_fem_noeud(void)
217     {
218     return FEM_TEMPLATE_ELEMENT<6>::get_nb_fem_noeud();
219     }
220    
221     FEM_NOEUD* FEM_PENTA6::get_fem_noeud(int num)
222     {
223     return FEM_TEMPLATE_ELEMENT<6>::get_fem_noeud(num);
224     }
225    
226     void FEM_PENTA6::change_noeud(int num,FEM_NOEUD* noeud)
227     {
228     FEM_TEMPLATE_ELEMENT<6>::change_noeud(num,noeud);
229     }
230    
231     BOITE_3D& FEM_PENTA6::get_boite_3D(void)
232     {
233     return FEM_TEMPLATE_ELEMENT<6>::get_boite_3D();
234     }
235    
236    
237     void FEM_PENTA6::enregistrer(std::ostream& o,double version)
238     {
239     if (maillage!=NULL)
240     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_PENTA6($"<< get_lien_topologie()->get_id() << ",$" << maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id() << ",$" << tab[4]->get_id() << ",$" << tab[5]->get_id() << ");" << std::endl;
241     else o << "%" << get_id() << "=FEM_PENTA6(NULL,$" << maillage->get_id() << ",$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id() << ",$" << tab[4]->get_id() << ",$" << tab[5]->get_id() << ");" << std::endl;
242     else
243     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_PENTA6($"<< get_lien_topologie()->get_id() << ",NULL,$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id() << ",$" << tab[4]->get_id() << ",$" << tab[5]->get_id() << ");" << std::endl;
244     else o << "%" << get_id() << "=FEM_PENTA6(NULL,NULL,$" << tab[0]->get_id() << ",$" << tab[1]->get_id() << ",$" << tab[2]->get_id()<< ",$" << tab[3]->get_id() << ",$" << tab[4]->get_id() << ",$" << tab[5]->get_id() <<");" << std::endl;
245    
246     }
247    
248    
249     int FEM_PENTA6::get_nb_pt_gauss(int degre)
250     {
251     return OT_POINTS_GAUSS::get_nb_point_penta(degre);
252     }
253    
254     void FEM_PENTA6::get_pt_gauss(int degre,int num,double &w,double *uvw)
255     {
256     return OT_POINTS_GAUSS::get_pt_gauss_penta(degre,num,w,uvw);
257     }
258    
259     int FEM_PENTA6::get_degre_gauss(int num)
260     {
261     return OT_POINTS_GAUSS::get_degre_gauss_penta(num);
262     }
263    
264     int FEM_PENTA6::get_nb_fonction_interpolation(void)
265     {
266     return 6;
267     }
268    
269     int FEM_PENTA6::get_degremax_fonction_interpolation(void)
270     {
271     return 2;
272     }
273     double FEM_PENTA6::get_fonction_interpolation(int num,double *uv)
274     {
275     double val;
276     switch (num)
277     {
278     case 1:
279     val=0.5*uv[1]*(1.-uv[0]);
280     break;
281     case 2:
282     val=0.5*uv[2]*(1.-uv[0]);
283     break;
284     case 3:
285     val=0.5*(1.-uv[1]-uv[2])*(1.-uv[0]);
286     break;
287     case 4:
288     val=0.5*uv[1]*(uv[0]+1.);
289     break;
290     case 5:
291     val=0.5*uv[2]*(uv[0]+1.);
292     break;
293     case 6:
294     val=0.5*(1.-uv[1]-uv[2])*(uv[0]+1);
295     break;
296     }
297     return val;
298     }
299    
300     double FEM_PENTA6::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
301     {
302     double val;
303     switch (num)
304     {
305     case 1:
306     switch (num_variable)
307     {
308     case 1:
309     val=-0.5*uv[1];
310     break;
311     case 2:
312     val=0.5*(1.-uv[0]);
313     break;
314     case 3:
315     val=0.;
316     break;
317     } break;
318     case 2:
319     switch (num_variable)
320     {
321     case 1:
322     val=-0.5*uv[2];
323     break;
324     case 2:
325     val=0.;
326     break;
327     case 3:
328     val=0.5*(1.-uv[0]);
329     break;
330     } break;
331     case 3:
332     switch (num_variable)
333     {
334     case 1:
335     val=-0.5*(1.-uv[1]-uv[2]);
336     break;
337     case 2:
338     val=-0.5*(1.-uv[0]);
339     break;
340     case 3:
341     val=-0.5*(1.-uv[0]);
342     break;
343     } break;
344     case 4:
345     switch (num_variable)
346     {
347     case 1:
348     val=0.5*uv[1];
349     break;
350     case 2:
351     val=0.5*(uv[0]+1.);
352     break;
353     case 3:
354     val=0.;
355     break;
356     } break;
357     case 5:
358     switch (num_variable)
359     {
360     case 1:
361     val=0.5*uv[2];
362     break;
363     case 2:
364     val=0;
365     break;
366     case 3:
367     val=0.5*(uv[1]+1.);
368     break;
369     } break;
370     case 6:
371     switch (num_variable)
372     {
373     case 1:
374     val=0.5*(1.-uv[1]-uv[2]);
375     break;
376     case 2:
377     val=-0.5*(uv[0]+1.);
378     break;
379     case 3:
380     val=-0.5*(uv[0]+1.);
381     break;
382     } break;
383     }
384     return val;
385     }
386    
387    
388    
389    
390    
391     int FEM_PENTA6::verifie_validite_decoupage_xfem(double *vol)
392     {
393 francois 1075 return 0.;
394     }