ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/mtu/src/fem_hexa20.cpp
Revision: 1158
Committed: Thu Jun 13 22:18:49 2024 UTC (11 months, 1 week ago) by francois
File size: 31136 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_hexa20.cpp
15     //####//
16     //####//------------------------------------------------------------
17     //####//------------------------------------------------------------
18     //####// COPYRIGHT 2000-2024
19     //####// jeu 13 jun 2024 11:58:55 EDT
20     //####//------------------------------------------------------------
21     //####//------------------------------------------------------------
22 francois 310
23    
24     #include "gestionversion.h"
25     #include "fem_hexa20.h"
26     #include "fem_maillage.h"
27     #include "fem_noeud.h"
28     #include "mg_element_maillage.h"
29     #include "ot_tenseur.h"
30 francois 754 #include "ot_quadrature_gauss.h"
31 francois 310
32    
33     FEM_HEXA20::FEM_HEXA20(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,mai),FEM_TEMPLATE_ELEMENT<20>(tabnoeud)
34     {
35 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
36 francois 310 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     tab[6]->get_lien_element3()->ajouter(this);
43     tab[7]->get_lien_element3()->ajouter(this);
44     tab[8]->get_lien_element3()->ajouter(this);
45     tab[9]->get_lien_element3()->ajouter(this);
46     tab[10]->get_lien_element3()->ajouter(this);
47     tab[11]->get_lien_element3()->ajouter(this);
48     tab[12]->get_lien_element3()->ajouter(this);
49     tab[13]->get_lien_element3()->ajouter(this);
50     tab[14]->get_lien_element3()->ajouter(this);
51     tab[15]->get_lien_element3()->ajouter(this);
52     tab[16]->get_lien_element3()->ajouter(this);
53     tab[17]->get_lien_element3()->ajouter(this);
54     tab[18]->get_lien_element3()->ajouter(this);
55     tab[19]->get_lien_element3()->ajouter(this);
56     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
57     }
58    
59     FEM_HEXA20::FEM_HEXA20(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(mai),FEM_TEMPLATE_ELEMENT<20>(tabnoeud)
60     {
61 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
62 francois 310 tab[0]->get_lien_element3()->ajouter(this);
63     tab[1]->get_lien_element3()->ajouter(this);
64     tab[2]->get_lien_element3()->ajouter(this);
65     tab[3]->get_lien_element3()->ajouter(this);
66     tab[4]->get_lien_element3()->ajouter(this);
67     tab[5]->get_lien_element3()->ajouter(this);
68     tab[6]->get_lien_element3()->ajouter(this);
69     tab[7]->get_lien_element3()->ajouter(this);
70     tab[8]->get_lien_element3()->ajouter(this);
71     tab[9]->get_lien_element3()->ajouter(this);
72     tab[10]->get_lien_element3()->ajouter(this);
73     tab[11]->get_lien_element3()->ajouter(this);
74     tab[12]->get_lien_element3()->ajouter(this);
75     tab[13]->get_lien_element3()->ajouter(this);
76     tab[14]->get_lien_element3()->ajouter(this);
77     tab[15]->get_lien_element3()->ajouter(this);
78     tab[16]->get_lien_element3()->ajouter(this);
79     tab[17]->get_lien_element3()->ajouter(this);
80     tab[18]->get_lien_element3()->ajouter(this);
81     tab[19]->get_lien_element3()->ajouter(this);
82     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
83     }
84    
85 francois 378 FEM_HEXA20::FEM_HEXA20(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,topo),FEM_TEMPLATE_ELEMENT<20>(tabnoeud)
86     {
87 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
88 francois 378 tab[0]->get_lien_element3()->ajouter(this);
89     tab[1]->get_lien_element3()->ajouter(this);
90     tab[2]->get_lien_element3()->ajouter(this);
91     tab[3]->get_lien_element3()->ajouter(this);
92     tab[4]->get_lien_element3()->ajouter(this);
93     tab[5]->get_lien_element3()->ajouter(this);
94     tab[6]->get_lien_element3()->ajouter(this);
95     tab[7]->get_lien_element3()->ajouter(this);
96     tab[8]->get_lien_element3()->ajouter(this);
97     tab[9]->get_lien_element3()->ajouter(this);
98     tab[10]->get_lien_element3()->ajouter(this);
99     tab[11]->get_lien_element3()->ajouter(this);
100     tab[12]->get_lien_element3()->ajouter(this);
101     tab[13]->get_lien_element3()->ajouter(this);
102     tab[14]->get_lien_element3()->ajouter(this);
103     tab[15]->get_lien_element3()->ajouter(this);
104     tab[16]->get_lien_element3()->ajouter(this);
105     tab[17]->get_lien_element3()->ajouter(this);
106     tab[18]->get_lien_element3()->ajouter(this);
107     tab[19]->get_lien_element3()->ajouter(this);
108     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
109     }
110    
111     FEM_HEXA20::FEM_HEXA20(class MG_ELEMENT_TOPOLOGIQUE* topo,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo),FEM_TEMPLATE_ELEMENT<20>(tabnoeud)
112     {
113 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
114 francois 378 tab[0]->get_lien_element3()->ajouter(this);
115     tab[1]->get_lien_element3()->ajouter(this);
116     tab[2]->get_lien_element3()->ajouter(this);
117     tab[3]->get_lien_element3()->ajouter(this);
118     tab[4]->get_lien_element3()->ajouter(this);
119     tab[5]->get_lien_element3()->ajouter(this);
120     tab[6]->get_lien_element3()->ajouter(this);
121     tab[7]->get_lien_element3()->ajouter(this);
122     tab[8]->get_lien_element3()->ajouter(this);
123     tab[9]->get_lien_element3()->ajouter(this);
124     tab[10]->get_lien_element3()->ajouter(this);
125     tab[11]->get_lien_element3()->ajouter(this);
126     tab[12]->get_lien_element3()->ajouter(this);
127     tab[13]->get_lien_element3()->ajouter(this);
128     tab[14]->get_lien_element3()->ajouter(this);
129     tab[15]->get_lien_element3()->ajouter(this);
130     tab[16]->get_lien_element3()->ajouter(this);
131     tab[17]->get_lien_element3()->ajouter(this);
132     tab[18]->get_lien_element3()->ajouter(this);
133     tab[19]->get_lien_element3()->ajouter(this);
134     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
135     }
136    
137     FEM_HEXA20::FEM_HEXA20(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<20>(tabnoeud)
138     {
139 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
140 francois 378 tab[0]->get_lien_element3()->ajouter(this);
141     tab[1]->get_lien_element3()->ajouter(this);
142     tab[2]->get_lien_element3()->ajouter(this);
143     tab[3]->get_lien_element3()->ajouter(this);
144     tab[4]->get_lien_element3()->ajouter(this);
145     tab[5]->get_lien_element3()->ajouter(this);
146     tab[6]->get_lien_element3()->ajouter(this);
147     tab[7]->get_lien_element3()->ajouter(this);
148     tab[8]->get_lien_element3()->ajouter(this);
149     tab[9]->get_lien_element3()->ajouter(this);
150     tab[10]->get_lien_element3()->ajouter(this);
151     tab[11]->get_lien_element3()->ajouter(this);
152     tab[12]->get_lien_element3()->ajouter(this);
153     tab[13]->get_lien_element3()->ajouter(this);
154     tab[14]->get_lien_element3()->ajouter(this);
155     tab[15]->get_lien_element3()->ajouter(this);
156     tab[16]->get_lien_element3()->ajouter(this);
157     tab[17]->get_lien_element3()->ajouter(this);
158     tab[18]->get_lien_element3()->ajouter(this);
159     tab[19]->get_lien_element3()->ajouter(this);
160     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
161     }
162    
163     FEM_HEXA20::FEM_HEXA20(class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo,mai),FEM_TEMPLATE_ELEMENT<20>(tabnoeud)
164     {
165 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
166 francois 378 tab[0]->get_lien_element3()->ajouter(this);
167     tab[1]->get_lien_element3()->ajouter(this);
168     tab[2]->get_lien_element3()->ajouter(this);
169     tab[3]->get_lien_element3()->ajouter(this);
170     tab[4]->get_lien_element3()->ajouter(this);
171     tab[5]->get_lien_element3()->ajouter(this);
172     tab[6]->get_lien_element3()->ajouter(this);
173     tab[7]->get_lien_element3()->ajouter(this);
174     tab[8]->get_lien_element3()->ajouter(this);
175     tab[9]->get_lien_element3()->ajouter(this);
176     tab[10]->get_lien_element3()->ajouter(this);
177     tab[11]->get_lien_element3()->ajouter(this);
178     tab[12]->get_lien_element3()->ajouter(this);
179     tab[13]->get_lien_element3()->ajouter(this);
180     tab[14]->get_lien_element3()->ajouter(this);
181     tab[15]->get_lien_element3()->ajouter(this);
182     tab[16]->get_lien_element3()->ajouter(this);
183     tab[17]->get_lien_element3()->ajouter(this);
184     tab[18]->get_lien_element3()->ajouter(this);
185     tab[19]->get_lien_element3()->ajouter(this);
186     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
187     }
188    
189    
190    
191    
192    
193    
194    
195    
196    
197 francois 310 FEM_HEXA20::FEM_HEXA20(FEM_HEXA20& mdd):FEM_ELEMENT3(mdd),FEM_TEMPLATE_ELEMENT<20>(mdd)
198     {
199 francois 581 if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this);
200 francois 310 tab[0]->get_lien_element3()->ajouter(this);
201     tab[1]->get_lien_element3()->ajouter(this);
202     tab[2]->get_lien_element3()->ajouter(this);
203     tab[3]->get_lien_element3()->ajouter(this);
204     tab[4]->get_lien_element3()->ajouter(this);
205     tab[5]->get_lien_element3()->ajouter(this);
206     tab[6]->get_lien_element3()->ajouter(this);
207     tab[7]->get_lien_element3()->ajouter(this);
208     tab[8]->get_lien_element3()->ajouter(this);
209     tab[9]->get_lien_element3()->ajouter(this);
210     tab[10]->get_lien_element3()->ajouter(this);
211     tab[11]->get_lien_element3()->ajouter(this);
212     tab[12]->get_lien_element3()->ajouter(this);
213     tab[13]->get_lien_element3()->ajouter(this);
214     tab[14]->get_lien_element3()->ajouter(this);
215     tab[15]->get_lien_element3()->ajouter(this);
216     tab[16]->get_lien_element3()->ajouter(this);
217     tab[17]->get_lien_element3()->ajouter(this);
218     tab[18]->get_lien_element3()->ajouter(this);
219     tab[19]->get_lien_element3()->ajouter(this);
220     get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this);
221     }
222     FEM_HEXA20::~FEM_HEXA20()
223     {
224 francois 663 if (liaison_topologique!=NULL)
225     if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->supprimer(this);
226 francois 310 tab[0]->get_lien_element3()->supprimer(this);
227     tab[1]->get_lien_element3()->supprimer(this);
228     tab[2]->get_lien_element3()->supprimer(this);
229     tab[3]->get_lien_element3()->supprimer(this);
230     tab[4]->get_lien_element3()->supprimer(this);
231     tab[5]->get_lien_element3()->supprimer(this);
232     tab[6]->get_lien_element3()->supprimer(this);
233     tab[7]->get_lien_element3()->supprimer(this);
234     tab[8]->get_lien_element3()->supprimer(this);
235     tab[9]->get_lien_element3()->supprimer(this);
236     tab[10]->get_lien_element3()->supprimer(this);
237     tab[11]->get_lien_element3()->supprimer(this);
238     tab[12]->get_lien_element3()->supprimer(this);
239     tab[13]->get_lien_element3()->supprimer(this);
240     tab[14]->get_lien_element3()->supprimer(this);
241     tab[15]->get_lien_element3()->supprimer(this);
242     tab[16]->get_lien_element3()->supprimer(this);
243     tab[17]->get_lien_element3()->supprimer(this);
244     tab[18]->get_lien_element3()->supprimer(this);
245     tab[19]->get_lien_element3()->supprimer(this);
246     get_fem_noeudpetitid()->get_lien_petit_element3()->supprimer(this);
247     }
248    
249    
250     FEM_ELEMENT_MAILLAGE* FEM_HEXA20::dupliquer(FEM_MAILLAGE *femmai,long decalage)
251     {
252 couturad 944 FEM_NOEUD* tabnoeud[20];
253 francois 310 tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage);
254     tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage);
255     tabnoeud[2]=femmai->get_fem_noeudid(tab[2]->get_id()+decalage);
256     tabnoeud[3]=femmai->get_fem_noeudid(tab[3]->get_id()+decalage);
257     tabnoeud[4]=femmai->get_fem_noeudid(tab[4]->get_id()+decalage);
258     tabnoeud[5]=femmai->get_fem_noeudid(tab[5]->get_id()+decalage);
259     tabnoeud[6]=femmai->get_fem_noeudid(tab[6]->get_id()+decalage);
260     tabnoeud[7]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
261     tabnoeud[8]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
262     tabnoeud[9]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
263     tabnoeud[10]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
264     tabnoeud[11]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
265     tabnoeud[12]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
266     tabnoeud[13]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
267     tabnoeud[14]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
268     tabnoeud[15]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
269     tabnoeud[16]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
270     tabnoeud[17]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
271     tabnoeud[18]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
272     tabnoeud[19]=femmai->get_fem_noeudid(tab[7]->get_id()+decalage);
273     FEM_HEXA20* quad=new FEM_HEXA20(get_id()+decalage,maillage,tabnoeud);
274     femmai->ajouter_fem_element3(quad);
275     return quad;
276     }
277    
278    
279 francois 786 void FEM_HEXA20::get_voisin_noeud(class FEM_NOEUD* no,TPL_LISTE_ENTITE<FEM_NOEUD*> &voisin)
280     {
281     voisin.vide();
282     if (no==tab[0])
283     {
284     voisin.ajouter(tab[1]);
285     voisin.ajouter(tab[7]);
286     voisin.ajouter(tab[8]);
287     }
288     if (no==tab[1])
289     {
290     voisin.ajouter(tab[0]);
291     voisin.ajouter(tab[2]);
292     }
293     if (no==tab[2])
294     {
295     voisin.ajouter(tab[1]);
296     voisin.ajouter(tab[3]);
297     voisin.ajouter(tab[9]);
298     }
299     if (no==tab[3])
300     {
301     voisin.ajouter(tab[2]);
302     voisin.ajouter(tab[4]);
303     }
304     if (no==tab[4])
305     {
306     voisin.ajouter(tab[3]);
307     voisin.ajouter(tab[5]);
308     voisin.ajouter(tab[10]);
309     }
310     if (no==tab[5])
311     {
312     voisin.ajouter(tab[4]);
313     voisin.ajouter(tab[6]);
314     }
315     if (no==tab[6])
316     {
317     voisin.ajouter(tab[5]);
318     voisin.ajouter(tab[7]);
319     voisin.ajouter(tab[11]);
320     }
321     if (no==tab[7])
322     {
323     voisin.ajouter(tab[0]);
324     voisin.ajouter(tab[6]);
325     }
326     if (no==tab[8])
327     {
328     voisin.ajouter(tab[0]);
329     voisin.ajouter(tab[12]);
330     }
331     if (no==tab[9])
332     {
333     voisin.ajouter(tab[2]);
334     voisin.ajouter(tab[14]);
335     }
336     if (no==tab[10])
337     {
338     voisin.ajouter(tab[4]);
339     voisin.ajouter(tab[16]);
340     }
341     if (no==tab[11])
342     {
343     voisin.ajouter(tab[6]);
344     voisin.ajouter(tab[18]);
345     }
346 francois 310
347 francois 786 if (no==tab[12])
348     {
349     voisin.ajouter(tab[8]);
350     voisin.ajouter(tab[13]);
351     voisin.ajouter(tab[19]);
352     }
353     if (no==tab[13])
354     {
355     voisin.ajouter(tab[12]);
356     voisin.ajouter(tab[14]);
357     }
358     if (no==tab[14])
359     {
360     voisin.ajouter(tab[9]);
361     voisin.ajouter(tab[13]);
362     voisin.ajouter(tab[15]);
363     }
364     if (no==tab[15])
365     {
366     voisin.ajouter(tab[14]);
367     voisin.ajouter(tab[16]);
368     }
369     if (no==tab[16])
370     {
371     voisin.ajouter(tab[10]);
372     voisin.ajouter(tab[15]);
373     voisin.ajouter(tab[17]);
374     }
375     if (no==tab[17])
376     {
377     voisin.ajouter(tab[16]);
378     voisin.ajouter(tab[18]);
379     }
380     if (no==tab[18])
381     {
382     voisin.ajouter(tab[11]);
383     voisin.ajouter(tab[17]);
384     voisin.ajouter(tab[19]);
385     }
386     if (no==tab[19])
387     {
388     voisin.ajouter(tab[18]);
389     voisin.ajouter(tab[12]);
390     }
391     }
392 francois 310
393    
394     int FEM_HEXA20::get_type_entite(void)
395     {
396 francois 1150 return MAGIC::TYPE_ENTITE::IDFEM_HEXA20;
397 francois 310 }
398    
399     int FEM_HEXA20::get_dimension(void)
400     {
401     return 3;
402     }
403    
404    
405    
406     int FEM_HEXA20::get_nb_fem_noeud(void)
407     {
408     return FEM_TEMPLATE_ELEMENT<20>::get_nb_fem_noeud();
409     }
410    
411     FEM_NOEUD* FEM_HEXA20::get_fem_noeud(int num)
412     {
413     return FEM_TEMPLATE_ELEMENT<20>::get_fem_noeud(num);
414     }
415    
416     void FEM_HEXA20::change_noeud(int num,FEM_NOEUD* noeud)
417     {
418     FEM_TEMPLATE_ELEMENT<20>::change_noeud(num,noeud);
419     }
420    
421     BOITE_3D& FEM_HEXA20::get_boite_3D(void)
422     {
423     return FEM_TEMPLATE_ELEMENT<20>::get_boite_3D();
424     }
425    
426    
427 francois 763 void FEM_HEXA20::enregistrer(std::ostream& o,double version)
428 francois 310 {
429 francois 378 if (maillage!=NULL)
430     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_HEXA20($"<< 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() << ",$" << tab[6]->get_id()<< ",$" << tab[7]->get_id()<< ",$" << tab[8]->get_id() << ",$" << tab[9]->get_id() << ",$" << tab[10]->get_id()<< ",$" << tab[11]->get_id() << ",$" << tab[12]->get_id() << ",$" << tab[13]->get_id() << ",$" << tab[14]->get_id() << ",$" << tab[15]->get_id() << ",$" << tab[16]->get_id()<< ",$" << tab[17]->get_id()<< ",$" << tab[18]->get_id()<< ",$" << tab[19]->get_id()<< ");" << std::endl;
431     else o << "%" << get_id() << "=FEM_HEXA20(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() << ",$" << tab[6]->get_id()<< ",$" << tab[7]->get_id()<< ",$" << tab[8]->get_id() << ",$" << tab[9]->get_id() << ",$" << tab[10]->get_id()<< ",$" << tab[11]->get_id() << ",$" << tab[12]->get_id() << ",$" << tab[13]->get_id() << ",$" << tab[14]->get_id() << ",$" << tab[15]->get_id() << ",$" << tab[16]->get_id()<< ",$" << tab[17]->get_id()<< ",$" << tab[18]->get_id()<< ",$" << tab[19]->get_id()<<");" << std::endl;
432     else
433     if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_HEXA20($"<< 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() << ",$" << tab[6]->get_id()<< ",$" << tab[7]->get_id()<< ",$" << tab[8]->get_id() << ",$" << tab[9]->get_id() << ",$" << tab[10]->get_id()<< ",$" << tab[11]->get_id() << ",$" << tab[12]->get_id() << ",$" << tab[13]->get_id() << ",$" << tab[14]->get_id() << ",$" << tab[15]->get_id() << ",$" << tab[16]->get_id()<< ",$" << tab[17]->get_id()<< ",$" << tab[18]->get_id()<< ",$" << tab[19]->get_id()<< ");" << std::endl;
434     else o << "%" << get_id() << "=FEM_HEXA20(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() << ",$" << tab[6]->get_id()<< ",$" << tab[7]->get_id()<< ",$" << tab[8]->get_id() << ",$" << tab[9]->get_id() << ",$" << tab[10]->get_id()<< ",$" << tab[11]->get_id() << ",$" << tab[12]->get_id() << ",$" << tab[13]->get_id() << ",$" << tab[14]->get_id() << ",$" << tab[15]->get_id() << ",$" << tab[16]->get_id()<< ",$" << tab[17]->get_id()<< ",$" << tab[18]->get_id()<< ",$" << tab[19]->get_id()<<");" << std::endl;
435    
436 francois 310 }
437 francois 637
438    
439    
440     int FEM_HEXA20::get_nb_pt_gauss(int degre)
441     {
442 francois 754 return OT_POINTS_GAUSS::get_nb_point_hexa_prod(degre);
443 francois 637 }
444    
445     void FEM_HEXA20::get_pt_gauss(int degre,int num,double &w,double *uvw)
446     {
447 francois 754 return OT_POINTS_GAUSS::get_pt_gauss_hex_prod(degre,num,w,uvw);
448 francois 637 }
449 francois 638 int FEM_HEXA20::get_nb_fonction_interpolation(void)
450 francois 310 {
451     return 20;
452     }
453 francois 638 int FEM_HEXA20::get_degremax_fonction_interpolation(void)
454     {
455     return 4;
456     }
457 francois 310
458 francois 757 int FEM_HEXA20::get_degre_gauss(int num)
459     {
460     return OT_POINTS_GAUSS::get_degre_gauss_hexa_prod(num);
461     }
462    
463    
464 francois 310 double FEM_HEXA20::get_fonction_interpolation(int num,double *uv)
465     {
466     double val;
467     switch (num)
468     {
469     case 1:
470     {double a=-1;
471     double b=-1;
472     double c=-1;
473     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
474     break;}
475     case 3:
476     {double a=1;
477     double b=-1;
478     double c=-1;
479     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
480     break;}
481     case 5:
482     {double a=1;
483     double b=1;
484     double c=-1;
485     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
486     break;}
487     case 7:
488     {double a=-1;
489     double b=1;
490     double c=-1;
491     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
492     break;}
493     case 13:
494     {double a=-1;
495     double b=-1;
496     double c=1;
497     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
498     break;}
499     case 15:
500     {double a=1;
501     double b=-1;
502     double c=1;
503     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
504     break;}
505     case 17:
506     {double a=1;
507     double b=1;
508     double c=1;
509     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
510     break;}
511     case 19:
512     {double a=-1;
513     double b=1;
514     double c=1;
515     val=0.125*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.+uv[2]*c)*(-2.+uv[0]*a+uv[1]*b+uv[2]*c);
516     break;}
517     case 2:
518     {double a=0.;
519     double b=-1;
520     double c=-1;
521     val=0.25*(1.-uv[0]*uv[0])*(1.+uv[1]*b)*(1.+uv[2]*c);
522     break;}
523     case 6:
524     {double a=0.;
525     double b=1;
526     double c=-1;
527     val=0.25*(1.-uv[0]*uv[0])*(1.+uv[1]*b)*(1.+uv[2]*c);
528     break;}
529     case 14:
530     {double a=0.;
531     double b=-1;
532     double c=1;
533     val=0.25*(1.-uv[0]*uv[0])*(1.+uv[1]*b)*(1.+uv[2]*c);
534     break;}
535     case 18:
536     {double a=0.;
537     double b=1;
538     double c=1;
539     val=0.25*(1.-uv[0]*uv[0])*(1.+uv[1]*b)*(1.+uv[2]*c);
540     break;}
541     case 4:
542     {double a=1.;
543     double b=0.;
544     double c=-1;
545     val=0.25*(1.+uv[0]*a)*(1.-uv[1]*uv[1])*(1.+uv[2]*c);
546     break;}
547     case 8:
548     {double a=-1.;
549     double b=0.;
550     double c=-1;
551     val=0.25*(1.+uv[0]*a)*(1.-uv[1]*uv[1])*(1.+uv[2]*c);
552     break;}
553     case 16:
554     {double a=1.;
555     double b=0.;
556     double c=1;
557     val=0.25*(1.+uv[0]*a)*(1.-uv[1]*uv[1])*(1.+uv[2]*c);
558     break;}
559     case 20:
560     {double a=-1.;
561     double b=0.;
562     double c=1;
563     val=0.25*(1.+uv[0]*a)*(1.-uv[1]*uv[1])*(1.+uv[2]*c);
564     break;}
565     case 9:
566     {double a=-1.;
567     double b=-1.;
568     double c=0.;
569     val=0.25*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.-uv[2]*uv[2]);
570     break;}
571     case 10:
572     {double a=1.;
573     double b=-1.;
574     double c=0.;
575     val=0.25*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.-uv[2]*uv[2]);
576     break;}
577     case 11:
578     {double a=1.;
579     double b=1.;
580     double c=0.;
581     val=0.25*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.-uv[2]*uv[2]);
582     break;}
583     case 12:
584     {double a=-1.;
585     double b=1.;
586     double c=0.;
587     val=0.25*(1.+uv[0]*a)*(1.+uv[1]*b)*(1.-uv[2]*uv[2]);
588     break;}
589    
590    
591     }
592     return val;
593     }
594 francois 684 void FEM_HEXA20::reinit_boite_3D(void)
595     {
596     FEM_TEMPLATE_ELEMENT<20>::reinit_boite_3D();
597     }
598 francois 310
599     double FEM_HEXA20::get_fonction_derive_interpolation(int num,int num_variable,double *uv)
600     {
601     double val;
602     switch (num)
603     {
604     case 1:
605     {
606     double a=-1;
607     double b=-1;
608     double c=-1;
609     switch (num_variable)
610     {
611     case 1:
612     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
613     break;
614     case 2:
615     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
616     break;
617     case 3:
618     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
619     break;
620     } break;}
621     case 3:
622     {
623     double a=1;
624     double b=-1;
625     double c=-1;
626     switch (num_variable)
627     {
628     case 1:
629     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
630     break;
631     case 2:
632     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
633     break;
634     case 3:
635     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
636     break;
637     } break;}
638     case 5:
639     {
640     double a=1;
641     double b=1;
642     double c=-1;
643     switch (num_variable)
644     {
645     case 1:
646     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
647     break;
648     case 2:
649     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
650     break;
651     case 3:
652     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
653     break;
654     } break;}
655     case 7:
656     {
657     double a=-1;
658     double b=1;
659     double c=-1;
660     switch (num_variable)
661     {
662     case 1:
663     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
664     break;
665     case 2:
666     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
667     break;
668     case 3:
669     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
670     break;
671     } break;}
672     case 13:
673     {
674     double a=-1;
675     double b=-1;
676     double c=1;
677     switch (num_variable)
678     {
679     case 1:
680     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
681     break;
682     case 2:
683     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
684     break;
685     case 3:
686     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
687     break;
688     } break;}
689     case 15:
690     {
691     double a=1;
692     double b=-1;
693     double c=1;
694     switch (num_variable)
695     {
696     case 1:
697     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
698     break;
699     case 2:
700     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
701     break;
702     case 3:
703     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
704     break;
705     } break;}
706     case 17:
707     {
708     double a=1;
709     double b=1;
710     double c=1;
711     switch (num_variable)
712     {
713     case 1:
714     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
715     break;
716     case 2:
717     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
718     break;
719     case 3:
720     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
721     break;
722     } break;}
723     case 19:
724     {
725     double a=-1;
726     double b=1;
727     double c=1;
728     switch (num_variable)
729     {
730     case 1:
731     val=0.125*a*(1+uv[1]*b)*(1+uv[2]*c)*(-1+2*uv[0]*a+uv[1]*b+uv[2]*c);
732     break;
733     case 2:
734     val=0.125*b*(1+uv[0]*a)*(1+uv[2]*c)*(-1+uv[0]*a+2*uv[1]*b+uv[2]*c);
735     break;
736     case 3:
737     val=0.125*c*(1+uv[0]*a)*(1+uv[1]*b)*(-1+uv[0]*a+uv[1]*b+2*uv[2]*c);
738     break;
739     } break;}
740     case 2:
741     {
742     double a=0;
743     double b=-1;
744     double c=-1;
745     switch (num_variable)
746     {
747     case 1:
748     val=-0.5*uv[0]*(1+uv[1]*b)*(1+uv[2]*c);
749     break;
750     case 2:
751     val=0.25*b*(1-uv[0]*uv[0])*(1+uv[2]*c);
752     break;
753     case 3:
754     val=0.25*c*(1-uv[0]*uv[0])*(1+uv[1]*b);
755     break;
756     } break;}
757     case 18:
758     {
759     double a=0;
760     double b=1;
761     double c=1;
762     switch (num_variable)
763     {
764     case 1:
765     val=-0.5*uv[0]*(1+uv[1]*b)*(1+uv[2]*c);
766     break;
767     case 2:
768     val=0.25*b*(1-uv[0]*uv[0])*(1+uv[2]*c);
769     break;
770     case 3:
771     val=0.25*c*(1-uv[0]*uv[0])*(1+uv[1]*b);
772     break;
773     } break;}
774     case 14:
775     {
776     double a=0;
777     double b=-1;
778     double c=1;
779     switch (num_variable)
780     {
781     case 1:
782     val=-0.5*uv[0]*(1+uv[1]*b)*(1+uv[2]*c);
783     break;
784     case 2:
785     val=0.25*b*(1-uv[0]*uv[0])*(1+uv[2]*c);
786     break;
787     case 3:
788     val=0.25*c*(1-uv[0]*uv[0])*(1+uv[1]*b);
789     break;
790     } break;}
791     case 6:
792     {
793     double a=0;
794     double b=1;
795     double c=-1;
796     switch (num_variable)
797     {
798     case 1:
799     val=-0.5*uv[0]*(1+uv[1]*b)*(1+uv[2]*c);
800     break;
801     case 2:
802     val=0.25*b*(1-uv[0]*uv[0])*(1+uv[2]*c);
803     break;
804     case 3:
805     val=0.25*c*(1-uv[0]*uv[0])*(1+uv[1]*b);
806     break;
807     } break;}
808     case 4:
809     {
810     double a=1;
811     double b=0;
812     double c=-1;
813     switch (num_variable)
814     {
815     case 1:
816     val=0.25*a*(1-uv[1]*uv[1])*(1+uv[2]*c);
817     break;
818     case 2:
819     val=-0.5*uv[1]*(1+uv[0]*a)*(1+uv[2]*c);
820     break;
821     case 3:
822     val=0.25*c*(1+uv[0]*a)*(1-uv[1]*uv[1]);
823     break;
824     } break;}
825     case 8:
826     {
827     double a=-1;
828     double b=0;
829     double c=-1;
830     switch (num_variable)
831     {
832     case 1:
833     val=0.25*a*(1-uv[1]*uv[1])*(1+uv[2]*c);
834     break;
835     case 2:
836     val=-0.5*uv[1]*(1+uv[0]*a)*(1+uv[2]*c);
837     break;
838     case 3:
839     val=0.25*c*(1+uv[0]*a)*(1-uv[1]*uv[1]);
840     break;
841     } break;}
842     case 16:
843     {
844     double a=1;
845     double b=0;
846     double c=1;
847     switch (num_variable)
848     {
849     case 1:
850     val=0.25*a*(1-uv[1]*uv[1])*(1+uv[2]*c);
851     break;
852     case 2:
853     val=-0.5*uv[1]*(1+uv[0]*a)*(1+uv[2]*c);
854     break;
855     case 3:
856     val=0.25*c*(1+uv[0]*a)*(1-uv[1]*uv[1]);
857     break;
858     } break;}
859     case 20:
860     {
861     double a=-1;
862     double b=0;
863     double c=1;
864     switch (num_variable)
865     {
866     case 1:
867     val=0.25*a*(1-uv[1]*uv[1])*(1+uv[2]*c);
868     break;
869     case 2:
870     val=-0.5*uv[1]*(1+uv[0]*a)*(1+uv[2]*c);
871     break;
872     case 3:
873     val=0.25*c*(1+uv[0]*a)*(1-uv[1]*uv[1]);
874     break;
875     } break;}
876     case 9:
877     {
878     double a=-1;
879     double b=-1;
880     double c=0.;
881     switch (num_variable)
882     {
883     case 1:
884     val=0.25*a*(1+uv[1]*b)*(1-uv[2]*uv[2]);
885     break;
886     case 2:
887     val=0.25*b*(1+uv[0]*a)*(1-uv[2]*uv[2]);
888     break;
889     case 3:
890     val=-0.5*uv[2]*(1+uv[0]*a)*(1+uv[1]*b);
891     break;
892     } break;}
893     case 10:
894     {
895     double a=1;
896     double b=-1;
897     double c=0.;
898     switch (num_variable)
899     {
900     case 1:
901     val=0.25*a*(1+uv[1]*b)*(1-uv[2]*uv[2]);
902     break;
903     case 2:
904     val=0.25*b*(1+uv[0]*a)*(1-uv[2]*uv[2]);
905     break;
906     case 3:
907     val=-0.5*uv[2]*(1+uv[0]*a)*(1+uv[1]*b);
908     break;
909     } break;}
910     case 11:
911     {
912     double a=1;
913     double b=1;
914     double c=0.;
915     switch (num_variable)
916     {
917     case 1:
918     val=0.25*a*(1+uv[1]*b)*(1-uv[2]*uv[2]);
919     break;
920     case 2:
921     val=0.25*b*(1+uv[0]*a)*(1-uv[2]*uv[2]);
922     break;
923     case 3:
924     val=-0.5*uv[2]*(1+uv[0]*a)*(1+uv[1]*b);
925     break;
926     } break;}
927     case 12:
928     {
929     double a=-1;
930     double b=1;
931     double c=0.;
932     switch (num_variable)
933     {
934     case 1:
935     val=0.25*a*(1+uv[1]*b)*(1-uv[2]*uv[2]);
936     break;
937     case 2:
938     val=0.25*b*(1+uv[0]*a)*(1-uv[2]*uv[2]);
939     break;
940     case 3:
941     val=-0.5*uv[2]*(1+uv[0]*a)*(1+uv[1]*b);
942     break;
943     } break;}
944    
945     }
946     return val;
947     }
948    
949    
950    
951 francois 635 bool FEM_HEXA20::valide_parametre_EF(double* uvw)
952     {
953 francois 674 if (uvw[0]>=-1.-1e-10)
954     if (uvw[1]>=-1.-1e-10)
955     if (uvw[2]>=-1.-1e-10)
956 francois 635 if (uvw[0]<=1.+1e-10)
957     if (uvw[1]<=1.+1e-10)
958     if (uvw[2]<=1.+1e-10)
959     return true;
960     return false;
961     }
962 francois 405
963 francois 406 int FEM_HEXA20::verifie_validite_decoupage_xfem(double *vol)
964 francois 405 {
965 francois 1075 return 0;
966 couturad 944 }