1 |
//------------------------------------------------------------ |
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_penta15.h" |
27 |
#include "fem_maillage.h" |
28 |
#include "fem_noeud.h" |
29 |
#include "mg_element_maillage.h" |
30 |
#include "ot_tenseur.h" |
31 |
#include "ot_quadrature_gauss.h" |
32 |
|
33 |
|
34 |
FEM_PENTA15::FEM_PENTA15(unsigned long num,class MG_ELEMENT_MAILLAGE* mai,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,mai),FEM_TEMPLATE_ELEMENT<15>(tabnoeud) |
35 |
{ |
36 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
37 |
tab[0]->get_lien_element3()->ajouter(this); |
38 |
tab[1]->get_lien_element3()->ajouter(this); |
39 |
tab[2]->get_lien_element3()->ajouter(this); |
40 |
tab[3]->get_lien_element3()->ajouter(this); |
41 |
tab[4]->get_lien_element3()->ajouter(this); |
42 |
tab[5]->get_lien_element3()->ajouter(this); |
43 |
tab[6]->get_lien_element3()->ajouter(this); |
44 |
tab[7]->get_lien_element3()->ajouter(this); |
45 |
tab[8]->get_lien_element3()->ajouter(this); |
46 |
tab[9]->get_lien_element3()->ajouter(this); |
47 |
tab[10]->get_lien_element3()->ajouter(this); |
48 |
tab[11]->get_lien_element3()->ajouter(this); |
49 |
tab[12]->get_lien_element3()->ajouter(this); |
50 |
tab[13]->get_lien_element3()->ajouter(this); |
51 |
tab[14]->get_lien_element3()->ajouter(this); |
52 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
53 |
} |
54 |
|
55 |
FEM_PENTA15::FEM_PENTA15(class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(mai),FEM_TEMPLATE_ELEMENT<15>(tabnoeud) |
56 |
{ |
57 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
58 |
tab[0]->get_lien_element3()->ajouter(this); |
59 |
tab[1]->get_lien_element3()->ajouter(this); |
60 |
tab[2]->get_lien_element3()->ajouter(this); |
61 |
tab[3]->get_lien_element3()->ajouter(this); |
62 |
tab[4]->get_lien_element3()->ajouter(this); |
63 |
tab[5]->get_lien_element3()->ajouter(this); |
64 |
tab[6]->get_lien_element3()->ajouter(this); |
65 |
tab[7]->get_lien_element3()->ajouter(this); |
66 |
tab[8]->get_lien_element3()->ajouter(this); |
67 |
tab[9]->get_lien_element3()->ajouter(this); |
68 |
tab[10]->get_lien_element3()->ajouter(this); |
69 |
tab[11]->get_lien_element3()->ajouter(this); |
70 |
tab[12]->get_lien_element3()->ajouter(this); |
71 |
tab[13]->get_lien_element3()->ajouter(this); |
72 |
tab[14]->get_lien_element3()->ajouter(this); |
73 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
74 |
} |
75 |
|
76 |
FEM_PENTA15::FEM_PENTA15(unsigned long num,class MG_ELEMENT_TOPOLOGIQUE* topo,class FEM_NOEUD** tabnoeud):FEM_ELEMENT3(num,topo),FEM_TEMPLATE_ELEMENT<15>(tabnoeud) |
77 |
{ |
78 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
79 |
tab[0]->get_lien_element3()->ajouter(this); |
80 |
tab[1]->get_lien_element3()->ajouter(this); |
81 |
tab[2]->get_lien_element3()->ajouter(this); |
82 |
tab[3]->get_lien_element3()->ajouter(this); |
83 |
tab[4]->get_lien_element3()->ajouter(this); |
84 |
tab[5]->get_lien_element3()->ajouter(this); |
85 |
tab[6]->get_lien_element3()->ajouter(this); |
86 |
tab[7]->get_lien_element3()->ajouter(this); |
87 |
tab[8]->get_lien_element3()->ajouter(this); |
88 |
tab[9]->get_lien_element3()->ajouter(this); |
89 |
tab[10]->get_lien_element3()->ajouter(this); |
90 |
tab[11]->get_lien_element3()->ajouter(this); |
91 |
tab[12]->get_lien_element3()->ajouter(this); |
92 |
tab[13]->get_lien_element3()->ajouter(this); |
93 |
tab[14]->get_lien_element3()->ajouter(this); |
94 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
95 |
} |
96 |
|
97 |
FEM_PENTA15::FEM_PENTA15(class MG_ELEMENT_TOPOLOGIQUE* topo,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo),FEM_TEMPLATE_ELEMENT<15>(tabnoeud) |
98 |
{ |
99 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
100 |
tab[0]->get_lien_element3()->ajouter(this); |
101 |
tab[1]->get_lien_element3()->ajouter(this); |
102 |
tab[2]->get_lien_element3()->ajouter(this); |
103 |
tab[3]->get_lien_element3()->ajouter(this); |
104 |
tab[4]->get_lien_element3()->ajouter(this); |
105 |
tab[5]->get_lien_element3()->ajouter(this); |
106 |
tab[6]->get_lien_element3()->ajouter(this); |
107 |
tab[7]->get_lien_element3()->ajouter(this); |
108 |
tab[8]->get_lien_element3()->ajouter(this); |
109 |
tab[9]->get_lien_element3()->ajouter(this); |
110 |
tab[10]->get_lien_element3()->ajouter(this); |
111 |
tab[11]->get_lien_element3()->ajouter(this); |
112 |
tab[12]->get_lien_element3()->ajouter(this); |
113 |
tab[13]->get_lien_element3()->ajouter(this); |
114 |
tab[14]->get_lien_element3()->ajouter(this); |
115 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
116 |
} |
117 |
|
118 |
FEM_PENTA15::FEM_PENTA15(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<15>(tabnoeud) |
119 |
{ |
120 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
121 |
tab[0]->get_lien_element3()->ajouter(this); |
122 |
tab[1]->get_lien_element3()->ajouter(this); |
123 |
tab[2]->get_lien_element3()->ajouter(this); |
124 |
tab[3]->get_lien_element3()->ajouter(this); |
125 |
tab[4]->get_lien_element3()->ajouter(this); |
126 |
tab[5]->get_lien_element3()->ajouter(this); |
127 |
tab[6]->get_lien_element3()->ajouter(this); |
128 |
tab[7]->get_lien_element3()->ajouter(this); |
129 |
tab[8]->get_lien_element3()->ajouter(this); |
130 |
tab[9]->get_lien_element3()->ajouter(this); |
131 |
tab[10]->get_lien_element3()->ajouter(this); |
132 |
tab[11]->get_lien_element3()->ajouter(this); |
133 |
tab[12]->get_lien_element3()->ajouter(this); |
134 |
tab[13]->get_lien_element3()->ajouter(this); |
135 |
tab[14]->get_lien_element3()->ajouter(this); |
136 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
137 |
} |
138 |
|
139 |
FEM_PENTA15::FEM_PENTA15(class MG_ELEMENT_TOPOLOGIQUE* topo,class MG_ELEMENT_MAILLAGE* mai,FEM_NOEUD** tabnoeud):FEM_ELEMENT3(topo,mai),FEM_TEMPLATE_ELEMENT<15>(tabnoeud) |
140 |
{ |
141 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
142 |
tab[0]->get_lien_element3()->ajouter(this); |
143 |
tab[1]->get_lien_element3()->ajouter(this); |
144 |
tab[2]->get_lien_element3()->ajouter(this); |
145 |
tab[3]->get_lien_element3()->ajouter(this); |
146 |
tab[4]->get_lien_element3()->ajouter(this); |
147 |
tab[5]->get_lien_element3()->ajouter(this); |
148 |
tab[6]->get_lien_element3()->ajouter(this); |
149 |
tab[7]->get_lien_element3()->ajouter(this); |
150 |
tab[8]->get_lien_element3()->ajouter(this); |
151 |
tab[9]->get_lien_element3()->ajouter(this); |
152 |
tab[10]->get_lien_element3()->ajouter(this); |
153 |
tab[11]->get_lien_element3()->ajouter(this); |
154 |
tab[12]->get_lien_element3()->ajouter(this); |
155 |
tab[13]->get_lien_element3()->ajouter(this); |
156 |
tab[14]->get_lien_element3()->ajouter(this); |
157 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
158 |
} |
159 |
|
160 |
|
161 |
|
162 |
|
163 |
FEM_PENTA15::FEM_PENTA15(FEM_PENTA15& mdd):FEM_ELEMENT3(mdd),FEM_TEMPLATE_ELEMENT<15>(mdd) |
164 |
{ |
165 |
if (liaison_topologique!=NULL) if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->ajouter(this); |
166 |
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 |
get_fem_noeudpetitid()->get_lien_petit_element3()->ajouter(this); |
182 |
} |
183 |
FEM_PENTA15::~FEM_PENTA15() |
184 |
{ |
185 |
if (liaison_topologique!=NULL) |
186 |
if (liaison_topologique->get_dimension()==3) liaison_topologique->get_lien_fem_maillage()->supprimer(this); |
187 |
tab[0]->get_lien_element3()->supprimer(this); |
188 |
tab[1]->get_lien_element3()->supprimer(this); |
189 |
tab[2]->get_lien_element3()->supprimer(this); |
190 |
tab[3]->get_lien_element3()->supprimer(this); |
191 |
tab[4]->get_lien_element3()->supprimer(this); |
192 |
tab[5]->get_lien_element3()->supprimer(this); |
193 |
tab[6]->get_lien_element3()->supprimer(this); |
194 |
tab[7]->get_lien_element3()->supprimer(this); |
195 |
tab[8]->get_lien_element3()->supprimer(this); |
196 |
tab[9]->get_lien_element3()->supprimer(this); |
197 |
tab[10]->get_lien_element3()->supprimer(this); |
198 |
tab[11]->get_lien_element3()->supprimer(this); |
199 |
tab[12]->get_lien_element3()->supprimer(this); |
200 |
tab[13]->get_lien_element3()->supprimer(this); |
201 |
tab[14]->get_lien_element3()->supprimer(this); |
202 |
get_fem_noeudpetitid()->get_lien_petit_element3()->supprimer(this); |
203 |
} |
204 |
|
205 |
|
206 |
FEM_ELEMENT_MAILLAGE* FEM_PENTA15::dupliquer(FEM_MAILLAGE *femmai,long decalage) |
207 |
{ |
208 |
FEM_NOEUD* tabnoeud[15]; |
209 |
tabnoeud[0]=femmai->get_fem_noeudid(tab[0]->get_id()+decalage); |
210 |
tabnoeud[1]=femmai->get_fem_noeudid(tab[1]->get_id()+decalage); |
211 |
tabnoeud[2]=femmai->get_fem_noeudid(tab[2]->get_id()+decalage); |
212 |
tabnoeud[3]=femmai->get_fem_noeudid(tab[3]->get_id()+decalage); |
213 |
tabnoeud[4]=femmai->get_fem_noeudid(tab[4]->get_id()+decalage); |
214 |
tabnoeud[5]=femmai->get_fem_noeudid(tab[5]->get_id()+decalage); |
215 |
tabnoeud[6]=femmai->get_fem_noeudid(tab[5]->get_id()+decalage); |
216 |
tabnoeud[7]=femmai->get_fem_noeudid(tab[6]->get_id()+decalage); |
217 |
tabnoeud[8]=femmai->get_fem_noeudid(tab[8]->get_id()+decalage); |
218 |
tabnoeud[9]=femmai->get_fem_noeudid(tab[9]->get_id()+decalage); |
219 |
tabnoeud[10]=femmai->get_fem_noeudid(tab[10]->get_id()+decalage); |
220 |
tabnoeud[11]=femmai->get_fem_noeudid(tab[11]->get_id()+decalage); |
221 |
tabnoeud[12]=femmai->get_fem_noeudid(tab[12]->get_id()+decalage); |
222 |
tabnoeud[13]=femmai->get_fem_noeudid(tab[13]->get_id()+decalage); |
223 |
tabnoeud[14]=femmai->get_fem_noeudid(tab[14]->get_id()+decalage); |
224 |
FEM_PENTA15* pen=new FEM_PENTA15(get_id()+decalage,maillage,tabnoeud); |
225 |
femmai->ajouter_fem_element3(pen); |
226 |
return pen; |
227 |
} |
228 |
|
229 |
void FEM_PENTA15::get_voisin_noeud(class FEM_NOEUD* no,TPL_LISTE_ENTITE<FEM_NOEUD*> &voisin) |
230 |
{ |
231 |
voisin.vide(); |
232 |
if (no==tab[0]) |
233 |
{ |
234 |
voisin.ajouter(tab[1]); |
235 |
voisin.ajouter(tab[5]); |
236 |
voisin.ajouter(tab[6]); |
237 |
} |
238 |
if (no==tab[1]) |
239 |
{ |
240 |
voisin.ajouter(tab[0]); |
241 |
voisin.ajouter(tab[2]); |
242 |
} |
243 |
if (no==tab[2]) |
244 |
{ |
245 |
voisin.ajouter(tab[1]); |
246 |
voisin.ajouter(tab[3]); |
247 |
voisin.ajouter(tab[7]); |
248 |
} |
249 |
if (no==tab[3]) |
250 |
{ |
251 |
voisin.ajouter(tab[2]); |
252 |
voisin.ajouter(tab[4]); |
253 |
} |
254 |
if (no==tab[4]) |
255 |
{ |
256 |
voisin.ajouter(tab[3]); |
257 |
voisin.ajouter(tab[5]); |
258 |
voisin.ajouter(tab[8]); |
259 |
} |
260 |
if (no==tab[5]) |
261 |
{ |
262 |
voisin.ajouter(tab[0]); |
263 |
voisin.ajouter(tab[4]); |
264 |
} |
265 |
if (no==tab[6]) |
266 |
{ |
267 |
voisin.ajouter(tab[0]); |
268 |
voisin.ajouter(tab[9]); |
269 |
} |
270 |
if (no==tab[7]) |
271 |
{ |
272 |
voisin.ajouter(tab[2]); |
273 |
voisin.ajouter(tab[11]); |
274 |
} |
275 |
if (no==tab[8]) |
276 |
{ |
277 |
voisin.ajouter(tab[4]); |
278 |
voisin.ajouter(tab[13]); |
279 |
} |
280 |
if (no==tab[9]) |
281 |
{ |
282 |
voisin.ajouter(tab[6]); |
283 |
voisin.ajouter(tab[10]); |
284 |
voisin.ajouter(tab[14]); |
285 |
} |
286 |
if (no==tab[10]) |
287 |
{ |
288 |
voisin.ajouter(tab[9]); |
289 |
voisin.ajouter(tab[11]); |
290 |
} |
291 |
if (no==tab[11]) |
292 |
{ |
293 |
voisin.ajouter(tab[7]); |
294 |
voisin.ajouter(tab[10]); |
295 |
voisin.ajouter(tab[12]); |
296 |
} |
297 |
if (no==tab[12]) |
298 |
{ |
299 |
voisin.ajouter(tab[11]); |
300 |
voisin.ajouter(tab[13]); |
301 |
} |
302 |
if (no==tab[13]) |
303 |
{ |
304 |
voisin.ajouter(tab[8]); |
305 |
voisin.ajouter(tab[12]); |
306 |
voisin.ajouter(tab[14]); |
307 |
} |
308 |
if (no==tab[14]) |
309 |
{ |
310 |
voisin.ajouter(tab[9]); |
311 |
voisin.ajouter(tab[13]); |
312 |
} |
313 |
|
314 |
|
315 |
|
316 |
} |
317 |
|
318 |
bool FEM_PENTA15::valide_parametre_EF(double* uvw) |
319 |
{ |
320 |
if (uvw[0]>=-1e-10) |
321 |
if (uvw[1]>=-1e-10) |
322 |
if (uvw[2]>=-1.-1e-10) |
323 |
if (1.-uvw[0]-uvw[1]<=1.+1e-10) |
324 |
if (uvw[2]<=1.+1e-10) |
325 |
return true; |
326 |
return false; |
327 |
} |
328 |
|
329 |
void FEM_PENTA15::reinit_boite_3D(void) |
330 |
{ |
331 |
FEM_TEMPLATE_ELEMENT<15>::reinit_boite_3D(); |
332 |
} |
333 |
|
334 |
int FEM_PENTA15::get_type_entite(void) |
335 |
{ |
336 |
return IDFEM_PENTA15; |
337 |
} |
338 |
|
339 |
int FEM_PENTA15::get_dimension(void) |
340 |
{ |
341 |
return 3; |
342 |
} |
343 |
|
344 |
|
345 |
|
346 |
int FEM_PENTA15::get_nb_fem_noeud(void) |
347 |
{ |
348 |
return FEM_TEMPLATE_ELEMENT<15>::get_nb_fem_noeud(); |
349 |
} |
350 |
|
351 |
FEM_NOEUD* FEM_PENTA15::get_fem_noeud(int num) |
352 |
{ |
353 |
return FEM_TEMPLATE_ELEMENT<15>::get_fem_noeud(num); |
354 |
} |
355 |
|
356 |
void FEM_PENTA15::change_noeud(int num,FEM_NOEUD* noeud) |
357 |
{ |
358 |
FEM_TEMPLATE_ELEMENT<15>::change_noeud(num,noeud); |
359 |
} |
360 |
|
361 |
BOITE_3D& FEM_PENTA15::get_boite_3D(void) |
362 |
{ |
363 |
return FEM_TEMPLATE_ELEMENT<15>::get_boite_3D(); |
364 |
} |
365 |
|
366 |
|
367 |
void FEM_PENTA15::enregistrer(std::ostream& o,double version) |
368 |
{ |
369 |
if (maillage!=NULL) |
370 |
if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_PENTA15($"<< 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() << ");" << std::endl; |
371 |
else o << "%" << get_id() << "=FEM_PENTA15(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() << ");" << std::endl; |
372 |
else |
373 |
if (get_lien_topologie()!=NULL) o << "%" << get_id() << "=FEM_PENTA15($"<< 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() << ");" << std::endl; |
374 |
else o << "%" << get_id() << "=FEM_PENTA15(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() << ");" << std::endl; |
375 |
|
376 |
} |
377 |
|
378 |
|
379 |
int FEM_PENTA15::get_nb_pt_gauss(int degre) |
380 |
{ |
381 |
return OT_POINTS_GAUSS::get_nb_point_penta(degre); |
382 |
} |
383 |
|
384 |
void FEM_PENTA15::get_pt_gauss(int degre,int num,double &w,double *uvw) |
385 |
{ |
386 |
return OT_POINTS_GAUSS::get_pt_gauss_penta(degre,num,w,uvw); |
387 |
} |
388 |
|
389 |
int FEM_PENTA15::get_degre_gauss(int num) |
390 |
{ |
391 |
return OT_POINTS_GAUSS::get_degre_gauss_penta(num); |
392 |
} |
393 |
|
394 |
int FEM_PENTA15::get_nb_fonction_interpolation(void) |
395 |
{ |
396 |
return 15; |
397 |
} |
398 |
|
399 |
int FEM_PENTA15::get_degremax_fonction_interpolation(void) |
400 |
{ |
401 |
return 3; |
402 |
} |
403 |
double FEM_PENTA15::get_fonction_interpolation(int num,double *uv) |
404 |
{ |
405 |
double val; |
406 |
switch (num) |
407 |
{ |
408 |
case 1: |
409 |
val=uv[1]*(1.-uv[0])*(2.*uv[1]-2.-uv[0])/2.; |
410 |
break; |
411 |
case 3: |
412 |
val=uv[2]*(1.-uv[0])*(2.*uv[2]-2.-uv[0])/2.; |
413 |
break; |
414 |
case 5: |
415 |
val=(uv[0]-1.)*(1.-uv[1]-uv[2])*(uv[0]+2*uv[1]+2*uv[2])/2.; |
416 |
break; |
417 |
case 10: |
418 |
val=uv[1]*(1.+uv[0])*(2*uv[1]-2.+uv[0])/2.; |
419 |
break; |
420 |
case 12: |
421 |
val=uv[2]*(1.+uv[0])*(2*uv[2]-2.+uv[0])/2.; |
422 |
break; |
423 |
case 14: |
424 |
val=(-uv[0]-1.)*(1.-uv[1]-uv[2])*(-uv[0]+2*uv[1]+2*uv[2])/2.; |
425 |
break; |
426 |
case 2: |
427 |
val=2.*uv[1]*uv[2]*(1.-uv[0]); |
428 |
break; |
429 |
case 4: |
430 |
val=2.*uv[2]*(1.-uv[0])*(1.-uv[1]-uv[2]); |
431 |
break; |
432 |
case 6: |
433 |
val=2.*uv[1]*(1.-uv[0])*(1.-uv[1]-uv[2]); |
434 |
break; |
435 |
case 7: |
436 |
val=uv[1]*(1.-uv[0]*uv[0]); |
437 |
break; |
438 |
case 8: |
439 |
val=uv[2]*(1.-uv[0]*uv[0]); |
440 |
break; |
441 |
case 9: |
442 |
val=(1.-uv[0]*uv[0])*(1.-uv[1]-uv[2]); |
443 |
break; |
444 |
case 11: |
445 |
val=2*uv[1]*uv[2]*(1+uv[0]); |
446 |
break; |
447 |
case 13: |
448 |
val=2*uv[2]*(1-uv[1]-uv[2])*(1.+uv[0]); |
449 |
break; |
450 |
case 15: |
451 |
val=2*uv[1]*(1-uv[1]-uv[2])*(1.+uv[0]); |
452 |
break; |
453 |
} |
454 |
return val; |
455 |
} |
456 |
|
457 |
double FEM_PENTA15::get_fonction_derive_interpolation(int num,int num_variable,double *uv) |
458 |
{ |
459 |
double val; |
460 |
switch (num) |
461 |
{ |
462 |
case 1: |
463 |
switch (num_variable) |
464 |
{ |
465 |
case 1: |
466 |
val=uv[1]*(2.*uv[0]-2.*uv[1]+1.)/2.; |
467 |
break; |
468 |
case 2: |
469 |
val=(uv[0]-1.)*(uv[0]-4.*uv[1]+2.)/2.; |
470 |
break; |
471 |
case 3: |
472 |
val=0.; |
473 |
break; |
474 |
} break; |
475 |
case 3: |
476 |
switch (num_variable) |
477 |
{ |
478 |
case 1: |
479 |
val=uv[2]*(2.*uv[0]-2.*uv[2]+1.)/2.; |
480 |
break; |
481 |
case 2: |
482 |
val=0.; |
483 |
break; |
484 |
case 3: |
485 |
val=(uv[0]-1.)*(uv[0]-4.*uv[2]+2.)/2.; |
486 |
break; |
487 |
} break; |
488 |
case 5: |
489 |
switch (num_variable) |
490 |
{ |
491 |
case 1: |
492 |
val=(1.-uv[1]-uv[2])*(2.*uv[0]+2.*uv[1]+2.*uv[2]-1.)/2.; |
493 |
break; |
494 |
case 2: |
495 |
val=(1.-uv[0])*(uv[0]+4.*uv[1]+4.*uv[2]-2.)/2.; |
496 |
break; |
497 |
case 3: |
498 |
val=(1.-uv[0])*(uv[0]+4.*uv[1]+4.*uv[2]-2.)/2.; |
499 |
break; |
500 |
} break; |
501 |
case 10: |
502 |
switch (num_variable) |
503 |
{ |
504 |
case 1: |
505 |
val=uv[1]*(2.*uv[0]+2.*uv[1]-1.)/2.; |
506 |
break; |
507 |
case 2: |
508 |
val=(uv[0]+1.)*(uv[0]+4.*uv[1]-2.)/2.; |
509 |
break; |
510 |
case 3: |
511 |
val=0.; |
512 |
break; |
513 |
} break; |
514 |
case 12: |
515 |
switch (num_variable) |
516 |
{ |
517 |
case 1: |
518 |
val=uv[2]*(2.*uv[0]+2*uv[2]-1.)/2.; |
519 |
break; |
520 |
case 2: |
521 |
val=0; |
522 |
break; |
523 |
case 3: |
524 |
val=(uv[0]+1.)*(uv[0]+4.*uv[2]-2.)/2.; |
525 |
break; |
526 |
} break; |
527 |
case 14: |
528 |
switch (num_variable) |
529 |
{ |
530 |
case 1: |
531 |
val=(1.-uv[1]-uv[2])*(2.*uv[0]-2.*uv[1]-2.*uv[2]+1.)/2.; |
532 |
break; |
533 |
case 2: |
534 |
val=-(uv[0]+1.)*(uv[0]-4.*uv[1]-4.*uv[2]+2.)/2.; |
535 |
break; |
536 |
case 3: |
537 |
val=-(uv[0]+1.)*(uv[0]-4.*uv[1]-4.*uv[2]+2.)/2.; |
538 |
break; |
539 |
} break; |
540 |
case 2: |
541 |
switch (num_variable) |
542 |
{ |
543 |
case 1: |
544 |
val=-2.*uv[1]*uv[2]; |
545 |
break; |
546 |
case 2: |
547 |
val=-2.*uv[2]*(uv[0]-1.); |
548 |
break; |
549 |
case 3: |
550 |
val=-2.*uv[1]*(uv[0]-1.); |
551 |
break; |
552 |
} break; |
553 |
case 4: |
554 |
switch (num_variable) |
555 |
{ |
556 |
case 1: |
557 |
val=2.*uv[2]*(uv[1]+uv[2]-1.); |
558 |
break; |
559 |
case 2: |
560 |
val=-2.*uv[2]*(uv[0]-1.); |
561 |
break; |
562 |
case 3: |
563 |
val=-2.*(uv[0]-1.)*(uv[1]+2.*uv[2]+1.); |
564 |
break; |
565 |
} break; |
566 |
case 6: |
567 |
switch (num_variable) |
568 |
{ |
569 |
case 1: |
570 |
val=2.*uv[1]*(uv[1]+uv[2]-1.); |
571 |
break; |
572 |
case 2: |
573 |
val=2.*(uv[0]-1.)*(2.*uv[1]+uv[2]-1.); |
574 |
break; |
575 |
case 3: |
576 |
val=2.*uv[1]*(uv[0]-1.); |
577 |
break; |
578 |
} break; |
579 |
case 7: |
580 |
switch (num_variable) |
581 |
{ |
582 |
case 1: |
583 |
val=-2.*uv[0]*uv[1]; |
584 |
break; |
585 |
case 2: |
586 |
val=1-uv[0]*uv[0]; |
587 |
break; |
588 |
case 3: |
589 |
val=0.; |
590 |
break; |
591 |
} break; |
592 |
case 8: |
593 |
switch (num_variable) |
594 |
{ |
595 |
case 1: |
596 |
val=-2.*uv[0]*uv[2]; |
597 |
break; |
598 |
case 2: |
599 |
val=0.; |
600 |
break; |
601 |
case 3: |
602 |
val=1.-uv[0]*uv[0]; |
603 |
break; |
604 |
} break; |
605 |
case 9: |
606 |
switch (num_variable) |
607 |
{ |
608 |
case 1: |
609 |
val=-2.*uv[0]*(uv[1]+uv[2]-1.); |
610 |
break; |
611 |
case 2: |
612 |
val=uv[0]*uv[0]-1.; |
613 |
break; |
614 |
case 3: |
615 |
val=uv[0]*uv[0]-1.; |
616 |
break; |
617 |
} break; |
618 |
case 11: |
619 |
switch (num_variable) |
620 |
{ |
621 |
case 1: |
622 |
val=-2.*uv[1]*uv[2]; |
623 |
break; |
624 |
case 2: |
625 |
val=2.*uv[2]*(1.+uv[0]); |
626 |
break; |
627 |
case 3: |
628 |
val=2.*uv[1]*(1.+uv[0]); |
629 |
break; |
630 |
} break; |
631 |
case 13: |
632 |
switch (num_variable) |
633 |
{ |
634 |
case 1: |
635 |
val=-2.*uv[2]*(uv[1]+uv[2]-1.); |
636 |
break; |
637 |
case 2: |
638 |
val=-2.*uv[2]*(uv[0]+1.); |
639 |
break; |
640 |
case 3: |
641 |
val=-2.*(uv[0]+1.)*(uv[1]+2.*uv[2]-1.); |
642 |
break; |
643 |
} break; |
644 |
case 15: |
645 |
switch (num_variable) |
646 |
{ |
647 |
case 1: |
648 |
val=-2.*uv[1]*(uv[1]+uv[2]-1.); |
649 |
break; |
650 |
case 2: |
651 |
val=-2*(uv[0]+1.)*(2*uv[1]+uv[2]-1.); |
652 |
break; |
653 |
case 3: |
654 |
val=-2.*uv[1]*(uv[0]+1.); |
655 |
break; |
656 |
} break; |
657 |
} |
658 |
return val; |
659 |
} |
660 |
|
661 |
double FEM_PENTA15::get_jacobien(double* jac,double *uv,int& li,int& col,double unite) |
662 |
{ |
663 |
li=3;col=3; |
664 |
OT_TENSEUR Ni(3,15),Xi(15,3); |
665 |
for (int i=0;i<3;i++) |
666 |
for (int j=0;j<15;j++) |
667 |
Ni(i,j)=get_fonction_derive_interpolation(j+1,i+1,uv); |
668 |
for (int i=0;i<15;i++) |
669 |
{ |
670 |
double *xyz=tab[i]->get_coord(); |
671 |
Xi(i,0)=xyz[0]*unite; |
672 |
Xi(i,1)=xyz[1]*unite; |
673 |
Xi(i,2)=xyz[2]*unite; |
674 |
} |
675 |
OT_TENSEUR jacobi=Ni*Xi; |
676 |
jac[0]=jacobi(0,0).get_x(); |
677 |
jac[1]=jacobi(0,1).get_x(); |
678 |
jac[2]=jacobi(0,2).get_x(); |
679 |
jac[3]=jacobi(1,0).get_x(); |
680 |
jac[4]=jacobi(1,1).get_x(); |
681 |
jac[5]=jacobi(1,2).get_x(); |
682 |
jac[6]=jacobi(2,0).get_x(); |
683 |
jac[7]=jacobi(2,1).get_x(); |
684 |
jac[8]=jacobi(2,2).get_x(); |
685 |
double det=jac[0]*jac[4]*jac[8]+jac[3]*jac[7]*jac[2]+jac[6]*jac[1]*jac[5]-jac[2]*jac[4]*jac[6]-jac[5]*jac[7]*jac[0]-jac[8]*jac[1]*jac[3]; |
686 |
return det; |
687 |
|
688 |
} |
689 |
|
690 |
void FEM_PENTA15::get_inverse_jacob(double* j,double *uv,double unite) |
691 |
{ |
692 |
double jac[9]; |
693 |
int li,col; |
694 |
double detj=get_jacobien(jac,uv,li,col,unite); |
695 |
j[0*3+0] = (jac[1*3+1]*jac[2*3+2]-jac[1*3+2]*jac[2*3+1])/(detj); |
696 |
j[0*3+1] = -(jac[0*3+1]*jac[2*3+2]-jac[0*3+2]*jac[2*3+1])/(detj); |
697 |
j[0*3+2] =-(-jac[0*3+1]*jac[1*3+2]+jac[0*3+2]*jac[1*3+1])/(detj); |
698 |
|
699 |
j[1*3+0] = -(jac[1*3+0]*jac[2*3+2]-jac[1*3+2]*jac[2*3+0])/(detj); |
700 |
j[1*3+1] = (jac[0*3+0]*jac[2*3+2]-jac[0*3+2]*jac[2*3+0])/(detj); |
701 |
j[1*3+2] = -(jac[0*3+0]*jac[1*3+2]-jac[0*3+2]*jac[1*3+0])/(detj); |
702 |
|
703 |
j[2*3+0] =-(-jac[1*3+0]*jac[2*3+1]+jac[1*3+1]*jac[2*3+0])/(detj); |
704 |
j[2*3+1] = -(jac[0*3+0]*jac[2*3+1]-jac[0*3+1]*jac[2*3+0])/(detj); |
705 |
j[2*3+2] = (jac[0*3+0]*jac[1*3+1]-jac[0*3+1]*jac[1*3+0])/(detj); |
706 |
|
707 |
} |
708 |
|
709 |
|
710 |
|
711 |
int FEM_PENTA15::verifie_validite_decoupage_xfem(double *vol) |
712 |
{ |
713 |
return 0.; |
714 |
} |