10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
13 #include "../classes.h"
14 #include "../../shared/shared.h"
20 #define NUMNODESP1_2d 3
22 #define NUMNODESP1xP2 9
23 #define NUMNODESP1xP3 12
24 #define NUMNODESP1xP4 15
25 #define NUMNODESP2xP1 12
27 #define NUMNODESP2b 19
28 #define NUMNODESP2xP4 30
29 #define NUMNODESMAX 30
46 switch(finiteelement){
49 indices = xNew<int>(numindices);
56 indices = xNew<int>(numindices);
63 indices = xNew<int>(numindices);
73 indices = xNew<int>(numindices);
80 indices = xNew<int>(numindices);
87 indices = xNew<int>(numindices);
94 indices = xNew<int>(numindices);
104 indices = xNew<int>(numindices);
114 indices = xNew<int>(numindices);
127 *pnumindices = numindices;
159 for(
int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
160 for(
int i=0;i<numnodes;i++) dpy += dbasis[1*numnodes+i]*plist[i];
161 for(
int i=0;i<numnodes;i++) dpz += dbasis[2*numnodes+i]*plist[i];
185 for(
int i=0;i<numnodes;i++) value += basis[i]*plist[i];
204 GaussPenta* gauss = xDynamicCast<GaussPenta*>(gauss_in);
235 j_const_reciprocal=
SQRT3/12;
237 J[3*0+0] = 0.25*(x1-x2-x4+x5)*zi+0.25*(-x1+x2-x4+x5);
238 J[3*1+0] = j_const_reciprocal*(x1+x2-2*x3-x4-x5+2*x6)*zi+j_const_reciprocal*(-x1-x2+2*x3-x4-x5+2*x6);
239 J[3*2+0] = j_const_reciprocal*(x1+x2-2*x3-x4-x5+2*x6)*eta+0.25*(x1-x2-x4+x5)*xi +0.25*(-x1+x5-x2+x4);
241 J[3*0+1] = 0.25*(y1-y2-y4+y5)*zi+0.25*(-y1+y2-y4+y5);
242 J[3*1+1] = j_const_reciprocal*(y1+y2-2*y3-y4-y5+2*y6)*zi+j_const_reciprocal*(-y1-y2+2*y3-y4-y5+2*y6);
243 J[3*2+1] = j_const_reciprocal*(y1+y2-2*y3-y4-y5+2*y6)*eta+0.25*(y1-y2-y4+y5)*xi+0.25*(y4-y1+y5-y2);
245 J[3*0+2] = 0.25*(z1-z2-z4+z5)*zi+0.25*(-z1+z2-z4+z5);
246 J[3*1+2] = j_const_reciprocal*(z1+z2-2*z3-z4-z5+2*z6)*zi+j_const_reciprocal*(-z1-z2+2*z3-z4-z5+2*z6);
247 J[3*2+2] = j_const_reciprocal*(z1+z2-2*z3-z4-z5+2*z6)*eta+0.25*(z1-z2-z4+z5)*xi+0.25*(-z1+z5-z2+z4);
260 if(*Jdet<0)
_error_(
"negative jacobian determinant!");
283 GaussPenta* gauss = xDynamicCast<GaussPenta*>(gauss_in);
288 switch(finiteelement){
293 basis[0]=gauss->
coord1*(1.-zeta)/2.;
294 basis[1]=gauss->
coord2*(1.-zeta)/2.;
295 basis[2]=gauss->
coord3*(1.-zeta)/2.;
296 basis[3]=gauss->
coord1*(1.+zeta)/2.;
297 basis[4]=gauss->
coord2*(1.+zeta)/2.;
298 basis[5]=gauss->
coord3*(1.+zeta)/2.;
301 basis[0]=gauss->
coord1*(1.-zeta)/2.;
302 basis[1]=gauss->
coord2*(1.-zeta)/2.;
303 basis[2]=gauss->
coord3*(1.-zeta)/2.;
304 basis[3]=gauss->
coord1*(1.+zeta)/2.;
305 basis[4]=gauss->
coord2*(1.+zeta)/2.;
306 basis[5]=gauss->
coord3*(1.+zeta)/2.;
311 basis[ 0]=gauss->
coord1*(2.*gauss->
coord1-1.)*(1.-zeta)/2.;
312 basis[ 1]=gauss->
coord2*(2.*gauss->
coord2-1.)*(1.-zeta)/2.;
313 basis[ 2]=gauss->
coord3*(2.*gauss->
coord3-1.)*(1.-zeta)/2.;
314 basis[ 3]=gauss->
coord1*(2.*gauss->
coord1-1.)*(1.+zeta)/2.;
315 basis[ 4]=gauss->
coord2*(2.*gauss->
coord2-1.)*(1.+zeta)/2.;
316 basis[ 5]=gauss->
coord3*(2.*gauss->
coord3-1.)*(1.+zeta)/2.;
327 basis[ 0]=gauss->
coord1*zeta*(zeta-1.)/2.;
328 basis[ 1]=gauss->
coord2*zeta*(zeta-1.)/2.;
329 basis[ 2]=gauss->
coord3*zeta*(zeta-1.)/2.;
330 basis[ 3]=gauss->
coord1*zeta*(zeta+1.)/2.;
331 basis[ 4]=gauss->
coord2*zeta*(zeta+1.)/2.;
332 basis[ 5]=gauss->
coord3*zeta*(zeta+1.)/2.;
334 basis[ 6]=gauss->
coord1*(1.-zeta*zeta);
335 basis[ 7]=gauss->
coord2*(1.-zeta*zeta);
336 basis[ 8]=gauss->
coord3*(1.-zeta*zeta);
340 basis[ 0]=gauss->
coord1*(2.*gauss->
coord1-1.)*zeta*(zeta-1.)/2.;
341 basis[ 1]=gauss->
coord2*(2.*gauss->
coord2-1.)*zeta*(zeta-1.)/2.;
342 basis[ 2]=gauss->
coord3*(2.*gauss->
coord3-1.)*zeta*(zeta-1.)/2.;
343 basis[ 3]=gauss->
coord1*(2.*gauss->
coord1-1.)*zeta*(zeta+1.)/2.;
344 basis[ 4]=gauss->
coord2*(2.*gauss->
coord2-1.)*zeta*(zeta+1.)/2.;
345 basis[ 5]=gauss->
coord3*(2.*gauss->
coord3-1.)*zeta*(zeta+1.)/2.;
347 basis[ 6]=gauss->
coord1*(2.*gauss->
coord1-1.)*(1.-zeta*zeta);
348 basis[ 7]=gauss->
coord2*(2.*gauss->
coord2-1.)*(1.-zeta*zeta);
349 basis[ 8]=gauss->
coord3*(2.*gauss->
coord3-1.)*(1.-zeta*zeta);
351 basis[ 9]=4.*gauss->
coord3*gauss->
coord2*zeta*(zeta-1.)/2.;
352 basis[10]=4.*gauss->
coord3*gauss->
coord1*zeta*(zeta-1.)/2.;
353 basis[11]=4.*gauss->
coord1*gauss->
coord2*zeta*(zeta-1.)/2.;
354 basis[12]=4.*gauss->
coord3*gauss->
coord2*zeta*(zeta+1.)/2.;
355 basis[13]=4.*gauss->
coord3*gauss->
coord1*zeta*(zeta+1.)/2.;
356 basis[14]=4.*gauss->
coord1*gauss->
coord2*zeta*(zeta+1.)/2.;
358 basis[15]=4.*gauss->
coord3*gauss->
coord2*(1.-zeta*zeta);
359 basis[16]=4.*gauss->
coord3*gauss->
coord1*(1.-zeta*zeta);
360 basis[17]=4.*gauss->
coord1*gauss->
coord2*(1.-zeta*zeta);
364 basis[ 0]=gauss->
coord1*(2.*gauss->
coord1-1.)*zeta*(zeta-1.)/2.;
365 basis[ 1]=gauss->
coord2*(2.*gauss->
coord2-1.)*zeta*(zeta-1.)/2.;
366 basis[ 2]=gauss->
coord3*(2.*gauss->
coord3-1.)*zeta*(zeta-1.)/2.;
367 basis[ 3]=gauss->
coord1*(2.*gauss->
coord1-1.)*zeta*(zeta+1.)/2.;
368 basis[ 4]=gauss->
coord2*(2.*gauss->
coord2-1.)*zeta*(zeta+1.)/2.;
369 basis[ 5]=gauss->
coord3*(2.*gauss->
coord3-1.)*zeta*(zeta+1.)/2.;
371 basis[ 6]=gauss->
coord1*(2.*gauss->
coord1-1.)*(1.-zeta*zeta);
372 basis[ 7]=gauss->
coord2*(2.*gauss->
coord2-1.)*(1.-zeta*zeta);
373 basis[ 8]=gauss->
coord3*(2.*gauss->
coord3-1.)*(1.-zeta*zeta);
375 basis[ 9]=4.*gauss->
coord3*gauss->
coord2*zeta*(zeta-1.)/2.;
376 basis[10]=4.*gauss->
coord3*gauss->
coord1*zeta*(zeta-1.)/2.;
377 basis[11]=4.*gauss->
coord1*gauss->
coord2*zeta*(zeta-1.)/2.;
378 basis[12]=4.*gauss->
coord3*gauss->
coord2*zeta*(zeta+1.)/2.;
379 basis[13]=4.*gauss->
coord3*gauss->
coord1*zeta*(zeta+1.)/2.;
380 basis[14]=4.*gauss->
coord1*gauss->
coord2*zeta*(zeta+1.)/2.;
382 basis[15]=4.*gauss->
coord3*gauss->
coord2*(1.-zeta*zeta);
383 basis[16]=4.*gauss->
coord3*gauss->
coord1*(1.-zeta*zeta);
384 basis[17]=4.*gauss->
coord1*gauss->
coord2*(1.-zeta*zeta);
390 basis[ 0]=gauss->
coord1*(2.*gauss->
coord1-1.)*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
391 basis[ 1]=gauss->
coord2*(2.*gauss->
coord2-1.)*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
392 basis[ 2]=gauss->
coord3*(2.*gauss->
coord3-1.)*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
393 basis[ 3]=gauss->
coord1*(2.*gauss->
coord1-1.)*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
394 basis[ 4]=gauss->
coord2*(2.*gauss->
coord2-1.)*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
395 basis[ 5]=gauss->
coord3*(2.*gauss->
coord3-1.)*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
397 basis[ 6]=gauss->
coord1*(2.*gauss->
coord1-1)*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
398 basis[ 7]=gauss->
coord2*(2.*gauss->
coord2-1)*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
399 basis[ 8]=gauss->
coord3*(2.*gauss->
coord3-1)*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
401 basis[ 9]=4.*gauss->
coord2*gauss->
coord3*(2./3.)*(zeta-1.)*(zeta-0.5)*zeta*(zeta+0.5);
402 basis[10]=4.*gauss->
coord1*gauss->
coord3*(2./3.)*(zeta-1.)*(zeta-0.5)*zeta*(zeta+0.5);
403 basis[11]=4.*gauss->
coord1*gauss->
coord2*(2./3.)*(zeta-1.)*(zeta-0.5)*zeta*(zeta+0.5);
404 basis[12]=4.*gauss->
coord2*gauss->
coord3*(2./3.)*(zeta-0.5)*zeta*(zeta+0.5)*(zeta+1.);
405 basis[13]=4.*gauss->
coord1*gauss->
coord3*(2./3.)*(zeta-0.5)*zeta*(zeta+0.5)*(zeta+1.);
406 basis[14]=4.*gauss->
coord1*gauss->
coord2*(2./3.)*(zeta-0.5)*zeta*(zeta+0.5)*(zeta+1.);
408 basis[15]=gauss->
coord1*(2.*gauss->
coord1-1.)*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
409 basis[16]=gauss->
coord2*(2.*gauss->
coord2-1.)*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
410 basis[17]=gauss->
coord3*(2.*gauss->
coord3-1.)*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
411 basis[18]=gauss->
coord1*(2.*gauss->
coord1-1.)*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
412 basis[19]=gauss->
coord2*(2.*gauss->
coord2-1.)*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
413 basis[20]=gauss->
coord3*(2.*gauss->
coord3-1.)*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
415 basis[21]=4.*gauss->
coord2*gauss->
coord3*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
416 basis[22]=4.*gauss->
coord1*gauss->
coord3*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
417 basis[23]=4.*gauss->
coord1*gauss->
coord2*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
418 basis[24]=4.*gauss->
coord2*gauss->
coord3*4.*(zeta-1.0)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
419 basis[25]=4.*gauss->
coord1*gauss->
coord3*4.*(zeta-1.0)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
420 basis[26]=4.*gauss->
coord1*gauss->
coord2*4.*(zeta-1.0)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
421 basis[27]=4.*gauss->
coord2*gauss->
coord3*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
422 basis[28]=4.*gauss->
coord1*gauss->
coord3*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
423 basis[29]=4.*gauss->
coord1*gauss->
coord2*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
427 basis[ 0]=-(9.)/(16.)*gauss->
coord1*(zeta-1)*(zeta-1./3.)*(zeta+1./3.);
428 basis[ 1]=-(9.)/(16.)*gauss->
coord2*(zeta-1)*(zeta-1./3.)*(zeta+1./3.);
429 basis[ 2]=-(9.)/(16.)*gauss->
coord3*(zeta-1)*(zeta-1./3.)*(zeta+1./3.);
430 basis[ 3]=(9.)/(16.)*gauss->
coord1*(zeta-1./3.)*(zeta+1./3.)*(zeta+1.);
431 basis[ 4]=(9.)/(16.)*gauss->
coord2*(zeta-1./3.)*(zeta+1./3.)*(zeta+1.);
432 basis[ 5]=(9.)/(16.)*gauss->
coord3*(zeta-1./3.)*(zeta+1./3.)*(zeta+1.);
434 basis[ 6]=(27.)/(16.)*gauss->
coord1*(zeta-1)*(zeta-1./3.)*(zeta+1.);
435 basis[ 7]=(27.)/(16.)*gauss->
coord2*(zeta-1)*(zeta-1./3.)*(zeta+1.);
436 basis[ 8]=(27.)/(16.)*gauss->
coord3*(zeta-1)*(zeta-1./3.)*(zeta+1.);
437 basis[ 9]=-(27.)/(16.)*gauss->
coord1*(zeta-1)*(zeta+1./3.)*(zeta+1.);
438 basis[10]=-(27.)/(16.)*gauss->
coord2*(zeta-1)*(zeta+1./3.)*(zeta+1.);
439 basis[11]=-(27.)/(16.)*gauss->
coord3*(zeta-1)*(zeta+1./3.)*(zeta+1.);
443 basis[ 0]=gauss->
coord1*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
444 basis[ 1]=gauss->
coord2*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
445 basis[ 2]=gauss->
coord3*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
446 basis[ 3]=gauss->
coord1*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
447 basis[ 4]=gauss->
coord2*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
448 basis[ 5]=gauss->
coord3*(2./3.)*(zeta-0.5)*(zeta)*(zeta+0.5)*(zeta +1.);
450 basis[ 6]=gauss->
coord1*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
451 basis[ 7]=gauss->
coord2*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
452 basis[ 8]=gauss->
coord3*4.*(zeta-1.)*(zeta-0.5)*(zeta+0.5)*(zeta+1.);
454 basis[ 9]=gauss->
coord1*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
455 basis[10]=gauss->
coord2*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
456 basis[11]=gauss->
coord3*(-8./3.)*(zeta-1.0)*(zeta-0.5)*zeta*(zeta+1.);
457 basis[12]=gauss->
coord1*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
458 basis[13]=gauss->
coord2*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
459 basis[14]=gauss->
coord3*(-8./3.)*(zeta-1.0)*zeta*(zeta+0.5)*(zeta+1.);
489 for(
int i=0;i<numnodes;i++){
490 dbasis[numnodes*0+i]=Jinv[0][0]*dbasis_ref[0*numnodes+i]+Jinv[0][1]*dbasis_ref[1*numnodes+i]+Jinv[0][2]*dbasis_ref[2*numnodes+i];
491 dbasis[numnodes*1+i]=Jinv[1][0]*dbasis_ref[0*numnodes+i]+Jinv[1][1]*dbasis_ref[1*numnodes+i]+Jinv[1][2]*dbasis_ref[2*numnodes+i];
492 dbasis[numnodes*2+i]=Jinv[2][0]*dbasis_ref[0*numnodes+i]+Jinv[2][1]*dbasis_ref[1*numnodes+i]+Jinv[2][2]*dbasis_ref[2*numnodes+i];
505 GaussPenta* gauss = xDynamicCast<GaussPenta*>(gauss_in);
510 switch(finiteelement){
824 dbasis[
NUMNODESP2xP4*0+0 ] = (-2* gauss->
coord1 + 0.5 ) *(2./3.) *(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5) ;
826 dbasis[
NUMNODESP2xP4*2+0 ] = gauss->
coord1 *(2.* gauss->
coord1 -1)* 2./3.*( (2.*zeta-1)*(zeta -0.5)*(zeta +0.5) + 2.* zeta *zeta *(zeta -1.));
828 dbasis[
NUMNODESP2xP4*0+1 ] = (2.*gauss->
coord2 - 0.5 ) *(2./3.) *(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5) ;
830 dbasis[
NUMNODESP2xP4*2+1 ] = gauss->
coord2*(2.*gauss->
coord2 -1.)* 2./3.* ((2.*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2. * zeta *zeta*(zeta -1.));
834 dbasis[
NUMNODESP2xP4*2+2 ] = gauss->
coord3*(2.* gauss->
coord3 -1.)* 2./3.*( (2.*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta -1.));
836 dbasis[
NUMNODESP2xP4*0+3 ] = (-2.* gauss->
coord1 + 0.5 ) *(2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
838 dbasis[
NUMNODESP2xP4*2+3 ] = gauss->
coord1*(2.*gauss->
coord1 -1.)* 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1.));
840 dbasis[
NUMNODESP2xP4*0+4 ] = (2*gauss->
coord2 - 0.5 ) *(2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
842 dbasis[
NUMNODESP2xP4*2+4 ] = gauss->
coord2 *(2.*gauss->
coord2 -1.)* 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1.));
846 dbasis[
NUMNODESP2xP4*2+5 ] = gauss->
coord3 *(2.*gauss->
coord3 -1.)* 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1));
848 dbasis[
NUMNODESP2xP4*0+6 ] = (-2.* gauss->
coord1 + 0.5 ) * 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
852 dbasis[
NUMNODESP2xP4*0+7 ] = (2*gauss->
coord2 - 0.5 )* 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
860 dbasis[
NUMNODESP2xP4*0+9 ] = 2.*gauss->
coord3 * 2./3.*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5) ;
862 dbasis[
NUMNODESP2xP4*2+9 ] = 4.* gauss->
coord2 * gauss->
coord3 *(2./3.)*((2.*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2.* zeta*zeta*(zeta -1.));
864 dbasis[
NUMNODESP2xP4*0+10] = -2.* gauss->
coord3* 2./3.*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5) ;
866 dbasis[
NUMNODESP2xP4*2+10] = 4.* gauss->
coord3*gauss->
coord1 *(2./3.)*( (2*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2* zeta * zeta*(zeta -1));
870 dbasis[
NUMNODESP2xP4*2+11] = 4.* gauss->
coord1*gauss->
coord2 *(2./3.) *( (2.*zeta-1)*(zeta -0.5)*(zeta +0.5) + 2* zeta* zeta*(zeta -1));
872 dbasis[
NUMNODESP2xP4*0+12] = 2.* gauss->
coord3 * 2./3.*(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
874 dbasis[
NUMNODESP2xP4*2+12] = 4.*gauss->
coord2*gauss->
coord3 *(2./3.)*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2*zeta*zeta*(zeta +1.));
876 dbasis[
NUMNODESP2xP4*0+13] = - 2.*gauss->
coord3* 2./3.*(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
878 dbasis[
NUMNODESP2xP4*2+13] = 4.*gauss->
coord3*gauss->
coord1 *(2./3.)*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1.));
882 dbasis[
NUMNODESP2xP4*2+14] = 4.*gauss->
coord1*gauss->
coord2 *(2./3.)*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2* zeta *zeta*(zeta +1.));
884 dbasis[
NUMNODESP2xP4*0+15] = (-2.* gauss->
coord1 + 0.5 )* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
886 dbasis[
NUMNODESP2xP4*2+15] = gauss->
coord1*(2.*gauss->
coord1-1) * (-8./3.)*((2.*zeta -1.)*(zeta-0.5)*(zeta +1.) +zeta*(zeta -1.)*( 2.*zeta + 0.5));
888 dbasis[
NUMNODESP2xP4*0+16] = (2*gauss->
coord2 - 0.5 )* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
890 dbasis[
NUMNODESP2xP4*2+16] = gauss->
coord2*(2.*gauss->
coord2-1) * (-8./3.)*((2.*zeta -1.)*(zeta-0.5)*(zeta +1.) +zeta *(zeta -1.)*( 2.*zeta + 0.5));
894 dbasis[
NUMNODESP2xP4*2+17] = gauss->
coord3*(2*gauss->
coord3-1) * (-8./3.)*((2.*zeta-1.)*(zeta-0.5)*(zeta +1.) +zeta *(zeta -1.)*( 2.*zeta + 0.5));
896 dbasis[
NUMNODESP2xP4*0+18] = (-2.* gauss->
coord1 + 0.5 ) * (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
898 dbasis[
NUMNODESP2xP4*2+18] = gauss->
coord1*(2.*gauss->
coord1-1) * (-8./3.)*((2.*zeta -1. ) *(zeta+0.5)* (zeta +1.) + zeta* (zeta -1.)*( 2.*zeta + 3./2.));
900 dbasis[
NUMNODESP2xP4*0+19] = (2*gauss->
coord2 - 0.5 )* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
902 dbasis[
NUMNODESP2xP4*2+19] = gauss->
coord2*(2.*gauss->
coord2-1)* (-8./3.)*((2.*zeta -1. )*(zeta+0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 3./2.));
906 dbasis[
NUMNODESP2xP4*2+20] = gauss->
coord3*(2*gauss->
coord3-1) * (-8./3.)*((2. *zeta -1. )*(zeta+0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 3./2.));
908 dbasis[
NUMNODESP2xP4*0+21] = 2. *gauss->
coord3 * (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. );
910 dbasis[
NUMNODESP2xP4*2+21] = 4.*gauss->
coord2 *gauss->
coord3* (-8./3.)*((2.*zeta -1. )*(zeta-0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 0.5));
912 dbasis[
NUMNODESP2xP4*0+22] = -2. *gauss->
coord3 *( -8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. );
914 dbasis[
NUMNODESP2xP4*2+22] = 4.*gauss->
coord1*gauss->
coord3* (-8./3.)*((2.*zeta -1. )*(zeta-0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 0.5));
918 dbasis[
NUMNODESP2xP4*2+23] = 4.*gauss->
coord1*gauss->
coord2* (-8./3.)*((2.*zeta -1. )* (zeta-0.5) *(zeta +1.) + zeta* (zeta -1.)*( 2.*zeta + 0.5));
920 dbasis[
NUMNODESP2xP4*0+24] = 2. *gauss->
coord3 *4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. );
924 dbasis[
NUMNODESP2xP4*0+25] = -2. *gauss->
coord3*4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. );
932 dbasis[
NUMNODESP2xP4*0+27] = 2.* gauss->
coord3* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. );
934 dbasis[
NUMNODESP2xP4*2+27] = 4.* gauss->
coord2*gauss->
coord3* (-8./3.)*((2.*zeta -1. )*(zeta+0.5)*(zeta +1.) +zeta*(zeta -1.)*( 2.*zeta + 3./2.));
936 dbasis[
NUMNODESP2xP4*0+28] = -2.*gauss->
coord3 *(-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. );
938 dbasis[
NUMNODESP2xP4*2+28] = 4.* gauss->
coord1*gauss->
coord3* (-8./3.)*((2.*zeta -1. )*(zeta+0.5)*(zeta +1.) +zeta*(zeta -1.)*( 2.*zeta + 3./2.));
942 dbasis[
NUMNODESP2xP4*2+29] = 4.* gauss->
coord1*gauss->
coord2 * (-8./3.)*((2.*zeta -1. )*(zeta+0.5)*(zeta +1) +zeta*(zeta -1.)*( 2.*zeta + 3./2.));
946 dbasis[
NUMNODESP1xP3*0+0 ] = (9./32.)*(zeta-1)*(zeta-1./3.)*(zeta+1./3.);
948 dbasis[
NUMNODESP1xP3*2+0 ] =- (9./16.)* gauss->
coord1 *( 2. *zeta *( zeta -1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
950 dbasis[
NUMNODESP1xP3*0+1 ] = - (9./32.)*(zeta-1)*(zeta-1./3.)*(zeta+1./3.);
952 dbasis[
NUMNODESP1xP3*2+1 ] =- (9./16.)*gauss->
coord2 *( 2.* zeta* ( zeta -1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
956 dbasis[
NUMNODESP1xP3*2+2 ] = - (9./16.)* gauss->
coord3* ( 2. *zeta *( zeta -1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
958 dbasis[
NUMNODESP1xP3*0+3 ] = - (9./32.)*(zeta-1./3.)*(zeta+1./3.)*(zeta+1.);
960 dbasis[
NUMNODESP1xP3*2+3 ] = (9./16.)* gauss->
coord1*( 2.* zeta *( zeta +1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
962 dbasis[
NUMNODESP1xP3*0+4 ] = (9./32.)* (zeta-1./3.)*(zeta+1./3.)*(zeta+1.);
964 dbasis[
NUMNODESP1xP3*2+4 ] = (9./16.)* gauss->
coord2* ( 2.* zeta *( zeta +1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
968 dbasis[
NUMNODESP1xP3*2+5 ] = (9./16.)* gauss->
coord3 *( 2.* zeta * ( zeta + 1. ) + ( zeta - (1./3.) )*( zeta + (1./3.) ));
970 dbasis[
NUMNODESP1xP3*0+6 ] = - (27./32.) *(zeta-1)*(zeta-1./3.)*(zeta+1.);
972 dbasis[
NUMNODESP1xP3*2+6 ] = gauss->
coord1*(27./16.)*( 2.* zeta *( zeta - (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
974 dbasis[
NUMNODESP1xP3*0+7 ] = (27./32.) *(zeta-1)*(zeta-1./3.)*(zeta+1.);
976 dbasis[
NUMNODESP1xP3*2+7 ] = gauss->
coord2*(27./16.)*( 2.* zeta *( zeta - (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
980 dbasis[
NUMNODESP1xP3*2+8 ] = gauss->
coord3*(27./16.)*( 2. *zeta *( zeta - (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
982 dbasis[
NUMNODESP1xP3*0+9 ] = (27./32.) *(zeta-1.)*(zeta+1./3.)*(zeta+1.);
984 dbasis[
NUMNODESP1xP3*2+9 ] = -gauss->
coord1 *(27./16.)*( 2* zeta *( zeta + (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
986 dbasis[
NUMNODESP1xP3*0+10] = - (27./32.) *(zeta-1)*(zeta+1./3.)*(zeta+1);
988 dbasis[
NUMNODESP1xP3*2+10] = -gauss->
coord2 *(27./16.) *( 2.* zeta *( zeta + (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
992 dbasis[
NUMNODESP1xP3*2+11] = -gauss->
coord3 *(27./16.)*( 2.* zeta *( zeta + (1./3.)) + ( zeta - 1. )*( zeta + 1. ));
996 dbasis[
NUMNODESP1xP4*0+0 ] = -0.5*(2./3.) *(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5);
997 dbasis[
NUMNODESP1xP4*1+0 ] = -
SQRT3/6.*(2./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5);
998 dbasis[
NUMNODESP1xP4*2+0 ] = gauss->
coord1 * 2./3.*( (2.*zeta-1)*(zeta -0.5)*(zeta +0.5) + 2.* zeta *zeta *(zeta -1.));
1000 dbasis[
NUMNODESP1xP4*0+1 ] = +0.5*(2./3.) *(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5);
1001 dbasis[
NUMNODESP1xP4*1+1 ] = -
SQRT3/6.*(2./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5);
1002 dbasis[
NUMNODESP1xP4*2+1 ] = gauss->
coord2* 2./3.* ((2.*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2. * zeta *zeta*(zeta -1.));
1005 dbasis[
NUMNODESP1xP4*1+2 ] =
SQRT3/3.*(2./3.)*(zeta -1.)*(zeta-0.5)*(zeta)*(zeta+0.5);
1006 dbasis[
NUMNODESP1xP4*2+2 ] = gauss->
coord3* 2./3.*( (2.*zeta-1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta -1.));
1008 dbasis[
NUMNODESP1xP4*0+3 ] = -0.5 *(2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
1009 dbasis[
NUMNODESP1xP4*1+3 ] = -
SQRT3/6.*(2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
1010 dbasis[
NUMNODESP1xP4*2+3 ] = gauss->
coord1* 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1.));
1012 dbasis[
NUMNODESP1xP4*0+4 ] = +0.5 * (2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
1013 dbasis[
NUMNODESP1xP4*1+4 ] = -
SQRT3/6.*(2./3.)*(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
1014 dbasis[
NUMNODESP1xP4*2+4 ] = gauss->
coord2 * 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1.));
1017 dbasis[
NUMNODESP1xP4*1+5 ] =
SQRT3/3.*(2./3.) *(zeta - 0.5)*(zeta)*(zeta+0.5)*(zeta +1. );
1018 dbasis[
NUMNODESP1xP4*2+5 ] = gauss->
coord3 * 2./3.*( (2.*zeta+1.)*(zeta -0.5)*(zeta +0.5) + 2.*zeta *zeta*(zeta +1));
1021 dbasis[
NUMNODESP1xP4*0+6 ] = -0.5 * 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
1022 dbasis[
NUMNODESP1xP4*1+6 ] = -
SQRT3/6.* 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1.) ;
1025 dbasis[
NUMNODESP1xP4*0+7 ] = +0.5* 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
1026 dbasis[
NUMNODESP1xP4*1+7 ] = -
SQRT3/6.* 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
1030 dbasis[
NUMNODESP1xP4*1+8 ] =
SQRT3/3. * 4.*(zeta - 1.)*(zeta - 0.5)*(zeta+0.5)*(zeta +1. ) ;
1034 dbasis[
NUMNODESP1xP4*0+9 ] = -0.5* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
1035 dbasis[
NUMNODESP1xP4*1+9 ] = -
SQRT3/6.* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
1036 dbasis[
NUMNODESP1xP4*2+9 ] = gauss->
coord1* (-8./3.)*((2.*zeta -1.)*(zeta-0.5)*(zeta +1.) +zeta*(zeta -1.)*( 2.*zeta + 0.5));
1038 dbasis[
NUMNODESP1xP4*0+10] = +0.5* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
1039 dbasis[
NUMNODESP1xP4*1+10] = -
SQRT3/6.* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
1040 dbasis[
NUMNODESP1xP4*2+10] = gauss->
coord2* (-8./3.)*((2.*zeta -1.)*(zeta-0.5)*(zeta +1.) +zeta *(zeta -1.)*( 2.*zeta + 0.5));
1043 dbasis[
NUMNODESP1xP4*1+11] =
SQRT3/3.* (-8./3.)*(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta +1. ) ;
1044 dbasis[
NUMNODESP1xP4*2+11] = gauss->
coord3* (-8./3.)*((2.*zeta-1.)*(zeta-0.5)*(zeta +1.) +zeta *(zeta -1.)*( 2.*zeta + 0.5));
1046 dbasis[
NUMNODESP1xP4*0+12] = -0.5* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
1047 dbasis[
NUMNODESP1xP4*1+12] = -
SQRT3/6.* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
1048 dbasis[
NUMNODESP1xP4*2+12] = gauss->
coord1* (-8./3.)*((2.*zeta -1. ) *(zeta+0.5)* (zeta +1.) + zeta* (zeta -1.)*( 2.*zeta + 3./2.));
1050 dbasis[
NUMNODESP1xP4*0+13] = +0.5* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
1051 dbasis[
NUMNODESP1xP4*1+13] = -
SQRT3/6.* (-8./3.)*(zeta - 1.)*(zeta)*(zeta+0.5)*(zeta +1. ) ;
1052 dbasis[
NUMNODESP1xP4*2+13] = gauss->
coord2* (-8./3.)*((2.*zeta -1. )*(zeta+0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 3./2.));
1055 dbasis[
NUMNODESP1xP4*1+14] =
SQRT3/3.* (-8./3.)*(zeta - 1.)*(zeta + 0.5)*(zeta)*(zeta +1. ) ;
1056 dbasis[
NUMNODESP1xP4*2+14] = gauss->
coord3* (-8./3.)*((2. *zeta -1. )*(zeta+0.5)*(zeta +1.) + zeta*(zeta -1.)*( 2.*zeta + 3./2.));
1068 IssmDouble x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4;
1085 *Jdet= sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) * (z4-z1 + z3-z2)/8.;
1086 if(*Jdet<0.)
_error_(
"negative jacobian determinant!");
1101 *Jdet=.5*sqrt(pow(x2-x1,2) + pow(y2-y1,2) + pow(z2-z1,2));
1102 if(*Jdet<0)
_error_(
"negative jacobian determinant!");
1121 *Jdet=
SQRT3/6.*pow(pow(((y2-y1)*(z3-z1)-(z2-z1)*(y3-y1)),2)+pow(((z2-z1)*(x3-x1)-(x2-x1)*(z3-z1)),2)+pow(((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)),2),0.5);
1122 if(*Jdet<0)
_error_(
"negative jacobian determinant!");
1129 int* indices = NULL;
1131 switch(finiteelement){
1134 indices = xNew<int>(numseg*2);
1135 indices[0*2 + 0] = 0; indices[0*2 + 1] = 3;
1136 indices[1*2 + 0] = 1; indices[1*2 + 1] = 4;
1137 indices[2*2 + 0] = 2; indices[2*2 + 1] = 5;
1141 indices = xNew<int>(numseg*2);
1142 indices[0*2 + 0] = 0; indices[0*2 + 1] = 3;
1143 indices[1*2 + 0] = 1; indices[1*2 + 1] = 4;
1144 indices[2*2 + 0] = 2; indices[2*2 + 1] = 5;
1148 indices = xNew<int>(numseg*2);
1149 indices[0*2 + 0] = 0; indices[0*2 + 1] = 3;
1150 indices[1*2 + 0] = 1; indices[1*2 + 1] = 4;
1151 indices[2*2 + 0] = 2; indices[2*2 + 1] = 5;
1152 indices[3*2 + 0] = 6; indices[3*2 + 1] = 9;
1153 indices[4*2 + 0] = 7; indices[4*2 + 1] = 10;
1154 indices[5*2 + 0] = 8; indices[5*2 + 1] = 11;
1158 indices = xNew<int>(numseg*2);
1159 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1160 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1161 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1165 indices = xNew<int>(numseg*2);
1166 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1167 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1168 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1172 indices = xNew<int>(numseg*2);
1173 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1174 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1175 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1179 indices = xNew<int>(numseg*2);
1180 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1181 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1182 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1183 indices[3*2 + 0] = 9; indices[3*2 + 1] = 15;
1184 indices[4*2 + 0] = 10; indices[4*2 + 1] = 16;
1185 indices[5*2 + 0] = 11; indices[5*2 + 1] = 17;
1189 indices = xNew<int>(numseg*2);
1190 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1191 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1192 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1193 indices[3*2 + 0] = 9; indices[3*2 + 1] = 15;
1194 indices[4*2 + 0] = 10; indices[4*2 + 1] = 16;
1195 indices[5*2 + 0] = 11; indices[5*2 + 1] = 17;
1199 indices = xNew<int>(numseg*2);
1200 indices[0*2 + 0] = 0; indices[0*2 + 1] = 6;
1201 indices[1*2 + 0] = 1; indices[1*2 + 1] = 7;
1202 indices[2*2 + 0] = 2; indices[2*2 + 1] = 8;
1203 indices[3*2 + 0] = 9; indices[3*2 + 1] = 15;
1204 indices[4*2 + 0] = 10; indices[4*2 + 1] = 16;
1205 indices[5*2 + 0] = 11; indices[5*2 + 1] = 17;
1213 *pindices = indices;
1218 switch(finiteelement){
1270 int* indices = NULL;
1272 switch(finiteelement){
1275 indices = xNew<int>(numindices);
1282 indices = xNew<int>(numindices);
1289 indices = xNew<int>(numindices);
1301 indices = xNew<int>(numindices);
1308 indices = xNew<int>(numindices);
1321 *pnumindices = numindices;
1322 *pindices = indices;