00001
00012 #ifndef _SHAPE_FUNCTIONS_BASSO_H_
00013 #define _SHAPE_FUNCTIONS_BASSO_H_
00014
00015 #include "basso.h"
00016 #include "gmm.h"
00017
00018 using namespace std;
00019 using namespace gmm;
00020 using namespace basso;
00021
00022 namespace basso {
00023
00024
00025
00026
00027
00028
00037 void shape_line2( nArray &Na, const Numeric &xi=0.0 )
00038 {
00039 #ifdef ALLOW_DYNAMIC_RESIZE
00040 if ( vect_size(Na)!=2 ) resize( Na, 2 );
00041 #elif EXPLICIT_BOUNDS_CHECK
00042 if ( vect_size(Na)!=2 ) ErrorMessage("shape_line2","Na must be of dimension 2");
00043 #endif
00044 Na[0]=0.5*(1.0-xi);
00045 Na[1]=0.5*(1.0+xi);
00046 }
00047
00055 void dshape_line2( nMatrix &dNa, const Numeric &xi=0.0 )
00056 {
00057 #ifdef ALLOW_DYNAMIC_RESIZE
00058 if ( mat_nrows(dNa)!=2 || mat_ncols(dNa)!=1 ) resize( dNa, 2, 1 );
00059 #elif EXPLICIT_BOUNDS_CHECK
00060 if ( mat_nrows(dNa)!=2 || mat_ncols(dNa)!=1 ) ErrorMessage("dshape_line2","dNa must be of dimension 2 by 1");
00061 #endif
00062 dNa(0,0)=-1.0;
00063 dNa(1,0)= 1.0;
00064 }
00065
00073 void shape_line3( nArray &Na, const Numeric &xi=0.0 )
00074 {
00075 #ifdef ALLOW_DYNAMIC_RESIZE
00076 if ( vect_size(Na)!=3 ) resize( Na, 3 );
00077 #elif EXPLICIT_BOUNDS_CHECK
00078 if ( vect_size(Na)!=3 ) ErrorMessage("shape_line3","Na must be of dimension 3");
00079 #endif
00080 Na[0]=0.5*(xi*xi-xi);
00081 Na[1]=0.5*(xi*xi+xi);
00082 Na[2]=1.0-xi*xi;
00083 }
00084
00094 void dshape_line3( nMatrix &dNa, const Numeric &xi=0.0 )
00095 {
00096 #ifdef ALLOW_DYNAMIC_RESIZE
00097 if ( mat_nrows(dNa)!=3 || mat_ncols(dNa)!=1 ) resize( dNa, 3, 1 );
00098 #elif EXPLICIT_BOUNDS_CHECK
00099 if ( mat_nrows(dNa)!=3 || mat_ncols(dNa)!=1 ) ErrorMessage("dshape_line3","dNa must be of dimension 3 by 1");
00100 #endif
00101 dNa(0,0)=xi-0.5;
00102 dNa(1,0)=xi+0.5;
00103 dNa(2,0)=-2*xi;
00104 }
00105
00115 void shape_tria3( nArray &Na, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00116 {
00117 #ifdef ALLOW_DYNAMIC_RESIZE
00118 if ( vect_size(Na)!=3 ) resize( Na, 3 );
00119 #elif EXPLICIT_BOUNDS_CHECK
00120 if ( vect_size(Na)!=3 ) ErrorMessage("shape_tria3","Na must be of dimension 3");
00121 #endif
00122 Na[0]=1.0-xi-eta;
00123 Na[1]=xi;
00124 Na[2]=eta;
00125 }
00126
00136 void dshape_tria3( nMatrix &dNa, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00137 {
00138 #ifdef ALLOW_DYNAMIC_RESIZE
00139 if ( mat_nrows(dNa)!=3 || mat_ncols(dNa)!=2 ) resize( dNa, 3, 2 );
00140 #elif EXPLICIT_BOUNDS_CHECK
00141 if ( mat_nrows(dNa)!=3 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_tria3","dNa must be of dimension 3 by 2");
00142 #endif
00143 dNa(0,0)=-1.0; dNa(0,1)=-1.0;
00144 dNa(1,0)= 1.0; dNa(1,1)= 0.0;
00145 dNa(2,0)=0.0; dNa(2,1)= 1.0;
00146 }
00147
00157 void shape_tria4( nArray &Na, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00158 {
00159 #ifdef ALLOW_DYNAMIC_RESIZE
00160 if ( vect_size(Na)!=4 ) resize( Na, 4 );
00161 #elif EXPLICIT_BOUNDS_CHECK
00162 if ( vect_size(Na)!=4 ) ErrorMessage("shape_tria4","Na must be of dimension 4");
00163 #endif
00164 Na[0]=1-3*(xi+eta)+4*xi*eta+2*(xi*xi+eta*eta);
00165 Na[1]=xi*(2*xi-1);
00166 Na[2]=eta*(2*eta-1);
00167 Na[3]=4*xi*(1-xi-eta);
00168 }
00169
00180 void dshape_tria4( nMatrix &dNa, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00181 {
00182 #ifdef ALLOW_DYNAMIC_RESIZE
00183 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=2 ) resize( dNa, 4, 2 );
00184 #elif EXPLICIT_BOUNDS_CHECK
00185 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_tria4","dNa must be of dimension 4 by 2");
00186 #endif
00187 dNa(0,0)=-1-3*eta; dNa(0,1)=-1-3*xi;
00188 dNa(1,0)=1-3*eta; dNa(1,1)=-3*xi;
00189 dNa(2,0)=-3*eta; dNa(2,1)=1-3*xi;
00190 dNa(3,0)=9*eta; dNa(3,1)= 9*xi;
00191 }
00192
00202 void shape_tria6( nArray &Na, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00203 {
00204 #ifdef ALLOW_DYNAMIC_RESIZE
00205 if ( vect_size(Na)!=6 ) resize( Na, 6 );
00206 #elif EXPLICIT_BOUNDS_CHECK
00207 if ( vect_size(Na)!=6 ) ErrorMessage("shape_tria6","Na must be of dimension 6");
00208 #endif
00209 Na[0]=1-3*(xi+eta)+4*xi*eta+2*(xi*xi+eta*eta);
00210 Na[1]=xi*(2*xi-1);
00211 Na[2]=eta*(2*eta-1);
00212 Na[3]=4*xi*(1-xi-eta);
00213 Na[4]=4*xi*eta;
00214 Na[5]=4*eta*(1-xi-eta);
00215 }
00216
00226 void dshape_tria6( nMatrix &dNa, const Numeric &xi=0.33333333333333, const Numeric &eta=0.33333333333333 )
00227 {
00228 #ifdef ALLOW_DYNAMIC_RESIZE
00229 if ( mat_nrows(dNa)!=6 || mat_ncols(dNa)!=2 ) resize( dNa, 6, 2 );
00230 #elif EXPLICIT_BOUNDS_CHECK
00231 if ( mat_nrows(dNa)!=6 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_tria6","dNa must be of dimension 6 by 2");
00232 #endif
00233 dNa(0,0)=4*(xi+eta)-3; dNa(0,0)=4*(xi+eta)-3;
00234 dNa(1,0)=4*xi-1; dNa(1,1)=0.0;
00235 dNa(2,0)=0.0; dNa(2,1)=4*eta-1;
00236 dNa(3,0)=4*(1-eta-2*xi); dNa(3,1)=-4*xi;
00237 dNa(4,0)=4*eta; dNa(4,1)=4*xi;
00238 dNa(5,0)=-4*eta; dNa(5,1)=4*(1-xi-2*eta);
00239 }
00240
00250 void shape_quad4( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00251 {
00252 #ifdef ALLOW_DYNAMIC_RESIZE
00253 if ( vect_size(Na)!=4 ) resize( Na, 4 );
00254 #elif EXPLICIT_BOUNDS_CHECK
00255 if ( vect_size(Na)!=4 ) ErrorMessage("shape_quad4","Na must be of dimension 4");
00256 #endif
00257 Na[0]=0.25*(1-xi)*(1-eta);
00258 Na[1]=0.25*(1+xi)*(1-eta);
00259 Na[2]=0.25*(1+xi)*(1+eta);
00260 Na[3]=0.25*(1-xi)*(1+eta);
00261 }
00262
00273 void dshape_quad4( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00274 {
00275 #ifdef ALLOW_DYNAMIC_RESIZE
00276 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=2 ) resize( dNa, 4, 2 );
00277 #elif EXPLICIT_BOUNDS_CHECK
00278 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_quad4","dNa must be of dimension 4 by 2");
00279 #endif
00280 dNa(0,0)=-0.25*(1-eta); dNa(0,1)= -0.25*(1-xi);
00281 dNa(1,0)=0.25*(1-eta); dNa(1,1)=-0.25*(1+xi);
00282 dNa(2,0)=0.25*(1+eta); dNa(2,1)=0.25*(1+xi);
00283 dNa(3,0)=-0.25*(1+eta); dNa(3,1)=0.25*(1-xi);
00284 }
00285
00294 void shape_quad8( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00295 {
00296 #ifdef ALLOW_DYNAMIC_RESIZE
00297 if ( vect_size(Na)!=8 ) resize( Na, 8 );
00298 #elif EXPLICIT_BOUNDS_CHECK
00299 if ( vect_size(Na)!=8 ) ErrorMessage("shape_quad8","Na must be of dimension 8");
00300 #endif
00301 Numeric r=0.5*(xi+1.0), s=0.5*(eta+1.0);
00302
00303 Na[1] = ( r - 1.0 ) * ( s - 1.0 ) * ( 1.0 - 2.0 * r - 2.0 * s );
00304 Na[1] = r * ( s - 1.0 ) * ( 1.0 - 2.0 * r + 2.0 * s );
00305 Na[2] = r * s * ( 2.0 * r + 2.0 * s - 3.0 );
00306 Na[3] = ( r - 1.0 ) * s * ( 2.0 * r - 2.0 * s + 1.0 );
00307 Na[4] = 4.0 * r * ( r - 1.0 ) * ( s - 1.0 );
00308 Na[5] = - 4.0 * r * s * ( s - 1.0 );
00309 Na[6] = - 4.0 * r * ( r - 1.0 ) * s;
00310 Na[7] = 4.0 * ( r - 1.0 ) * s * ( s - 1.0 );
00311
00312 }
00313
00323 void dshape_quad8( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00324 {
00325 #ifdef ALLOW_DYNAMIC_RESIZE
00326 if ( mat_nrows(dNa)!=8 || mat_ncols(dNa)!=2 ) resize( dNa, 8, 2 );
00327 #elif EXPLICIT_BOUNDS_CHECK
00328 if ( mat_nrows(dNa)!=8 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_quad8","dNa must be of dimension 8 by 2");
00329 #endif
00330
00331 Numeric r=0.5*(xi+1.0), s=0.5*(eta+1.0);
00332
00333 dNa(0,0) = ( s - 1.0 ) * ( - 4.0 * r - 2.0 * s + 3.0 );
00334 dNa(1,0) = ( s - 1.0 ) * ( - 4.0 * r + 2.0 * s + 1.0 );
00335 dNa(2,0) = s * ( 4.0 * r + 2.0 * s - 3.0 );
00336 dNa(3,0) = s * ( 4.0 * r - 2.0 * s - 1.0 );
00337 dNa(4,0) = 4.0 * ( 2.0 * r - 1.0 ) * ( s - 1.0 );
00338 dNa(5,0) = - 4.0 * s * ( s - 1.0 );
00339 dNa(6,0) = - 4.0 * ( 2.0 * r - 1.0 ) * s;
00340 dNa(7,0) = 4.0 * s * ( s - 1.0 );
00341
00342 dNa(0,1) = ( r - 1.0 ) * ( - 4.0 * s - 2.0 * r + 3.0 );
00343 dNa(1,1) = r * ( 4.0 * s - 2.0 * r - 1.0 );
00344 dNa(2,1) = r * ( 4.0 * s + 2.0 * r - 3.0 );
00345 dNa(3,1) = ( r - 1.0 ) * ( - 4.0 * s + 2.0 * r + 1.0 );
00346 dNa(4,1) = 4.0 * r * ( r - 1.0 );
00347 dNa(5,1) = - 4.0 * r * ( 2.0 * s - 1.0 );
00348 dNa(6,1) = - 4.0 * r * ( r - 1.0 );
00349 dNa(7,1) = 4.0 * ( r - 1.0 ) * ( 2.0 * s - 1.0 );
00350 }
00351
00361 void shape_quad9( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00362 {
00363 #ifdef ALLOW_DYNAMIC_RESIZE
00364 if ( vect_size(Na)!=9 ) resize( Na, 9 );
00365 #elif EXPLICIT_BOUNDS_CHECK
00366 if ( vect_size(Na)!=9 ) ErrorMessage("shape_quad9","Na must be of dimension 9");
00367 #endif
00368 Na[0]=0.25*xi*eta*(xi-1)*(eta-1);
00369 Na[1]=0.25*xi*eta*(xi+1)*(eta-1);
00370 Na[2]=0.25*xi*eta*(xi+1)*(eta+1);
00371 Na[3]=0.25*xi*eta*(xi-1)*(eta+1);
00372 Na[4]=-0.5*eta*(xi+1)*(xi-1)*(eta-1);
00373 Na[5]=-0.5*xi*(xi+1)*(eta+1)*(eta-1);
00374 Na[6]=-0.5*eta*(xi+1)*(xi-1)*(eta+1);
00375 Na[7]=-0.5*xi*(xi-1)*(eta+1)*(eta-1);
00376 Na[8]=(xi+1)*(xi-1)*(eta+1)*(eta-1);
00377
00378 }
00379
00390 void dshape_quad9( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00391 {
00392 #ifdef ALLOW_DYNAMIC_RESIZE
00393 if ( mat_nrows(dNa)!=9 || mat_ncols(dNa)!=2 ) resize( dNa, 9, 2 );
00394 #elif EXPLICIT_BOUNDS_CHECK
00395 if ( mat_nrows(dNa)!=9 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_quad9","dNa must be of dimension 9 by 2");
00396 #endif
00397 dNa(0,0)=0.25*eta*(2*xi-1)*(eta-1); dNa(0,1)=0.25*xi*(xi-1)*(2*eta-1);
00398 dNa(1,0)=0.25*eta*(2*xi+1)*(eta-1); dNa(1,1)=0.25*xi*(xi+1)*(2*eta-1);
00399 dNa(2,0)=0.25*eta*(2*xi+1)*(eta+1); dNa(2,1)=0.25*xi*(xi+1)*(2*eta+1);
00400 dNa(3,0)=0.25*eta*(2*xi-1)*(eta+1); dNa(3,1)=0.25*xi*(xi-1)*(2*eta+1);
00401 dNa(4,0)=-xi*eta*(eta-1); dNa(4,1)=-0.5*(xi+1)*(xi-1)*(2*eta-1);
00402 dNa(5,0)=-0.5*(2*xi+1)*(eta+1)*(eta-1); dNa(5,1)=-xi*eta*(xi+1);
00403 dNa(6,0)=-xi*eta*(eta+1); dNa(6,1)=-0.5*(xi+1)*(xi-1)*(2*eta+1);
00404 dNa(7,0)=-0.5*(2*xi-1)*(eta+1)*(eta-1); dNa(7,1)=-xi*eta*(xi-1);
00405 dNa(8,0)=2*xi*(eta*eta-1); dNa(8,1)=2*eta*(xi*xi-1);
00406
00407 }
00408
00409
00419 void shape_quad12( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00420 {
00421 #ifdef ALLOW_DYNAMIC_RESIZE
00422 if ( vect_size(Na)!=12 ) resize( Na, 12 );
00423 #elif EXPLICIT_BOUNDS_CHECK
00424 if ( vect_size(Na)!=12 ) ErrorMessage("shape_quad12","Na must be of dimension 12");
00425 #endif
00426 Numeric r=0.5*(xi+1.0), s=0.5*(eta+1.0);
00427 Numeric a = 0.0, b = 1.0/3.0, c = 2.0/3.0, d = 1.0;
00428 Numeric corner = 9.0 * ( ( 2.0 * r - 1.0 ) * ( 2.0 * r - 1.0 )
00429 + ( 2.0 * s - 1.0 ) * ( 2.0 * s - 1.0 ) ) - 10.0;
00430
00431 Na[0] = 0.125 * ( r - d ) * ( s - d ) * corner;
00432 Na[1] = - 0.125 * ( r - a ) * ( s - d ) * corner;
00433 Na[2] = 0.125 * ( r - a ) * ( s - a ) * corner;
00434 Na[3] = - 0.125 * ( r - d ) * ( s - a ) * corner;
00435 Na[4] = - 13.5 * ( r - a ) * ( r - c ) * ( r - d ) * ( s - d );
00436 Na[5] = 13.5 * ( r - a ) * ( r - b ) * ( r - d ) * ( s - d );
00437 Na[6] = 13.5 * ( r - a ) * ( s - a ) * ( s - c ) * ( s - d );
00438 Na[7] = - 13.5 * ( r - a ) * ( s - a ) * ( s - b ) * ( s - d );
00439 Na[8] = - 13.5 * ( r - a ) * ( r - b ) * ( r - d ) * ( s - a );
00440 Na[9] = 13.5 * ( r - a ) * ( r - c ) * ( r - d ) * ( s - a );
00441 Na[10] = 13.5 * ( r - d ) * ( s - a ) * ( s - b ) * ( s - d );
00442 Na[11] = - 13.5 * ( r - d ) * ( s - a ) * ( s - c ) * ( s - d );
00443
00444
00445 }
00446
00458 void dshape_quad12( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0 )
00459 {
00460 #ifdef ALLOW_DYNAMIC_RESIZE
00461 if ( mat_nrows(dNa)!=12 || mat_ncols(dNa)!=2 ) resize( dNa, 12, 2 );
00462 #elif EXPLICIT_BOUNDS_CHECK
00463 if ( mat_nrows(dNa)!=12 || mat_ncols(dNa)!=2 ) ErrorMessage("dshape_quad12","dNa must be of dimension 12 by 2");
00464 #endif
00465 Numeric r=0.5*(xi+1.0), s=0.5*(eta+1.0);
00466 Numeric a = 0.0, b = 1.0/3.0, c = 2.0/3.0, d = 1.0;
00467 Numeric corner = 9.0 * ( ( 2.0 * r - 1.0 ) * ( 2.0 * r - 1.0 )
00468 + ( 2.0 * s - 1.0 ) * ( 2.0 * s - 1.0 ) ) - 10.0;
00469
00470 Numeric dcdr = 36.0 * ( 2.0 * r - 1.0 );
00471 dNa(0,0) = 0.125 * ( s - d ) * ( ( r - d ) * dcdr + corner );
00472 dNa(4,0) = - 13.5 * ( s - d ) * ( 3.0 * r * r
00473 - 2.0 * ( a + c + d ) * r + a * c + c * d + d * a );
00474 dNa(5,0) = 13.5 * ( s - d ) * ( 3.0 * r * r
00475 - 2.0 * ( a + b + d ) * r + a * b + b * d + d * a );
00476 dNa(1,0) = - 0.125 * ( s - d ) * ( ( r - a ) * dcdr + corner );
00477 dNa(11,0) = - 13.5 * ( s - a ) * ( s - c ) * ( s - d );
00478 dNa(6,0) = 13.5 * ( s - a ) * ( s - c ) * ( s - d );
00479 dNa(10,0) = 13.5 * ( s - a ) * ( s - b ) * ( s - d );
00480 dNa(7,0) = - 13.5 * ( s - a ) * ( s - b ) * ( s - d );
00481 dNa(3,0) = - 0.125 * ( s - a ) * ( ( r - d ) * dcdr + corner );
00482 dNa(9,0) = 13.5 * ( s - a ) * ( 3.0 * r * r
00483 - 2.0 * ( a + c + d ) * r + a * c + c * d + d * a );
00484 dNa(8,0) = - 13.5 * ( s - a ) * ( 3.0 * r * r
00485 - 2.0 * ( a + b + d ) * r + a * b + b * d + d * a );
00486 dNa(2,0) = 0.125 * ( s - a ) * ( ( r - a ) * dcdr + corner );
00487
00488 Numeric dcds = 36.0 * ( 2.0 * s - 1.0 );
00489 dNa(0,1) = 0.125 * ( r - d ) * ( corner + ( s - d ) * dcds );
00490 dNa(4,1) = - 13.5 * ( r - a ) * ( r - c ) * ( r - d ) ;
00491 dNa(5,1) = 13.5 * ( r - a ) * ( r - b ) * ( r - d );
00492 dNa(1,1) = - 0.125 * ( r - a ) * ( corner + ( s - d ) * dcds );
00493 dNa(11,1) = - 13.5 * ( r - d ) * ( 3.0 * s * s
00494 - 2.0 * ( a + c + d ) * s + a * c + c * d + d * a );
00495 dNa(6,1) = 13.5 * ( r - a ) * ( 3.0 * s * s
00496 - 2.0 * ( a + c + d ) * s + a * c + c * d + d * a );
00497 dNa(10,1) = 13.5 * ( r - d ) * ( 3.0 * s * s
00498 - 2.0 * ( a + b + d ) * s + a * b + b * d + d * a );
00499 dNa(7,1) = - 13.5 * ( r - a ) * ( 3.0 * s * s
00500 - 2.0 * ( a + b + d ) * s + a * b + b * d + d * a );
00501 dNa(3,1) = - 0.125 * ( r - d ) * ( corner + ( s - a ) * dcds );
00502 dNa(9,1) = 13.5 * ( r - a ) * ( r - c ) * ( r - d ) ;
00503 dNa(8,1) = - 13.5 * ( r - a ) * ( r - b ) * ( r - d ) ;
00504 dNa(2,1) = 0.125 * ( r - a ) * ( corner + ( s - a ) * dcds );
00505
00506 }
00507
00508
00520 void shape_tetra4( nArray &Na, const Numeric &xi=0.166666666666667, const Numeric &eta=0.166666666666667,
00521 const Numeric &zeta=0.166666666666667 )
00522 {
00523 #ifdef ALLOW_DYNAMIC_RESIZE
00524 if ( vect_size(Na)!=4 ) resize( Na, 4 );
00525 #elif EXPLICIT_BOUNDS_CHECK
00526 if ( vect_size(Na)!=4 ) ErrorMessage("shape_tetra4","Na must be of dimension 4");
00527 #endif
00528 Na[0]=1-xi-eta-zeta;
00529 Na[1]=xi;
00530 Na[2]=eta;
00531 Na[3]=zeta;
00532 }
00533
00545 void dshape_tetra4( nMatrix &dNa, const Numeric &xi=0.166666666666667, const Numeric &eta=0.166666666666667,
00546 const Numeric &zeta=0.166666666666667 )
00547 {
00548 #ifdef ALLOW_DYNAMIC_RESIZE
00549 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=3 ) resize( dNa, 4, 3 );
00550 #elif EXPLICIT_BOUNDS_CHECK
00551 if ( mat_nrows(dNa)!=4 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_tetra4","dNa must be of dimension 4 by 3");
00552 #endif
00553
00554 dNa(0,0)=-1.0; dNa(0,1)=-1.0; dNa(0,2)=-1.0;
00555 dNa(1,0)= 1.0; dNa(1,1)= 0.0; dNa(1,2)= 0.0;
00556 dNa(2,0)= 0.0; dNa(2,1)= 1.0; dNa(2,2)= 0.0;
00557 dNa(3,0)= 0.0; dNa(3,1)= 0.0; dNa(3,2)= 1.0;
00558
00559 }
00560
00572 void shape_tetra10( nArray &Na, const Numeric &xi=0.166666666666667, const Numeric &eta=0.166666666666667,
00573 const Numeric &zeta=0.166666666666667 )
00574 {
00575 #ifdef ALLOW_DYNAMIC_RESIZE
00576 if ( vect_size(Na)!=10 ) resize( Na, 10 );
00577 #elif EXPLICIT_BOUNDS_CHECK
00578 if ( vect_size(Na)!=10 ) ErrorMessage("shape_tetra10","Na must be of dimension 10");
00579 #endif
00580 Numeric l2=xi, l3=eta, l4=zeta, l1=1-xi-eta-zeta;
00581
00582 Na[0] = l1*(2*l1-1);
00583 Na[1] = l2*(2*l2-1);
00584 Na[2] = l3*(2*l3-1);
00585 Na[3] = l4*(2*l4-1);
00586 Na[4] = 4*l1*l2;
00587 Na[5] = 4*l3*l2;
00588 Na[6] = 4*l1*l3;
00589 Na[7] = 4*l1*l4;
00590 Na[8] = 4*l4*l2;
00591 Na[9]= 4*l3*l4;
00592 }
00593
00606 void dshape_tetra10( nMatrix &dNa, const Numeric &xi=0.166666666666667, const Numeric &eta=0.166666666666667,
00607 const Numeric &zeta=0.166666666666667 )
00608 {
00609 #ifdef ALLOW_DYNAMIC_RESIZE
00610 if ( mat_nrows(dNa)!=10 || mat_ncols(dNa)!=3 ) resize( dNa, 10, 3 );
00611 #elif EXPLICIT_BOUNDS_CHECK
00612 if ( mat_nrows(dNa)!=10 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_tetra10","dNa must be of dimension 10 by 3");
00613 #endif
00614 Numeric l2=xi, l3=eta, l4=zeta, l1=1-xi-eta-zeta;
00615
00616 dNa(0,0)=-(4*l1-1); dNa(0,1)=-(4*l1-1); dNa(0,2)=-(4*l1-1);
00617 dNa(1,0)= 4*l2-1; dNa(1,1)= 0.0; dNa(1,2)= 0.0;
00618 dNa(2,0)= 0.0; dNa(2,1)= 4*l3-1; dNa(2,2)= 0.0;
00619 dNa(3,0)= 0.0; dNa(3,1)= 0.0; dNa(3,2)= 4*l4-1;
00620 dNa(4,0)=4*(l1-l2); dNa(4,1)=-4*l2; dNa(4,2)=-4*l2;
00621 dNa(5,0)= 4*l3; dNa(5,1)= 4*l2; dNa(5,2)= 0.0;
00622 dNa(6,0)=-4*l3; dNa(6,1)=4*(l1-l3); dNa(6,2)=-4*l3;
00623 dNa(7,0)=-4*l4; dNa(7,1)=-4*l4; dNa(7,2)=4*(l1-l4);
00624 dNa(8,0)= 4*l4; dNa(8,1)= 0.0; dNa(8,2)= 4*l2;
00625 dNa(9,0)= 0.0; dNa(9,1)= 4*l4; dNa(9,2)= 4*l3;
00626
00627 }
00628
00640 void shape_hexa8( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00641 {
00642 #ifdef ALLOW_DYNAMIC_RESIZE
00643 if ( vect_size(Na)!=8 ) resize( Na, 8 );
00644 #elif EXPLICIT_BOUNDS_CHECK
00645 if ( vect_size(Na)!=8 ) ErrorMessage("shape_hexa8","Na must be of dimension 8");
00646 #endif
00647 Na[0] = 0.125*(1-xi)*(1-eta)*(1-zeta);
00648 Na[1] = 0.125*(1+xi)*(1-eta)*(1-zeta);
00649 Na[2] = 0.125*(1+xi)*(1+eta)*(1-zeta);
00650 Na[3] = 0.125*(1-xi)*(1+eta)*(1-zeta);
00651 Na[4] = 0.125*(1-xi)*(1-eta)*(1+zeta);
00652 Na[5] = 0.125*(1+xi)*(1-eta)*(1+zeta);
00653 Na[6] = 0.125*(1+xi)*(1+eta)*(1+zeta);
00654 Na[7] = 0.125*(1-xi)*(1+eta)*(1+zeta);
00655 }
00656
00668 void dshape_hexa8( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00669 {
00670 #ifdef ALLOW_DYNAMIC_RESIZE
00671 if ( mat_nrows(dNa)!=8 || mat_ncols(dNa)!=3 ) resize( dNa, 8, 3 );
00672 #elif EXPLICIT_BOUNDS_CHECK
00673 if ( mat_nrows(dNa)!=8 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_hexa8","dNa must be of dimension 8 by 3");
00674 #endif
00675
00676 dNa(0,0)=0.125*(-1+eta+zeta-eta*zeta); dNa(0,1)=0.125*(-1+xi+zeta-xi*zeta); dNa(0,2)=0.125*(-1+xi+eta-xi*eta);
00677 dNa(1,0)=0.125*(1-eta-zeta+eta*zeta); dNa(1,1)=0.125*(-1-xi+zeta+xi*zeta); dNa(1,2)=0.125*(-1-xi+eta+xi*eta);
00678 dNa(2,0)=0.125*(1+eta-zeta-eta*zeta); dNa(2,1)=0.125*(1+xi-zeta-xi*zeta); dNa(2,2)=0.125*(-1-xi-eta-xi*eta);
00679 dNa(3,0)=0.125*(-1-eta+zeta+eta*zeta); dNa(3,1)=0.125*(1-xi-zeta+xi*zeta); dNa(3,2)=0.125*(-1+xi-eta+xi*eta);
00680 dNa(4,0)=0.125*(-1+eta-zeta+eta*zeta); dNa(4,1)=0.125*(-1+xi-zeta+xi*zeta); dNa(4,2)=0.125*(1-xi-eta+xi*eta);
00681 dNa(5,0)=0.125*(1-eta+zeta-eta*zeta); dNa(5,1)=0.125*(-1-xi-zeta-xi*zeta); dNa(5,2)=0.125*(1+xi-eta-xi*eta);
00682 dNa(6,0)=0.125*(1+eta+zeta+eta*zeta); dNa(6,1)=0.125*(1+xi+zeta+xi*zeta); dNa(6,2)=0.125*(1+xi+eta+xi*eta);
00683 dNa(7,0)=0.125*(-1-eta-zeta-eta*zeta); dNa(7,1)=0.125*(1-xi+zeta-xi*zeta); dNa(7,2)=0.125*(1-xi+eta-xi*eta);
00684
00685 }
00686
00697 void shape_hexa20( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00698 {
00699 #ifdef ALLOW_DYNAMIC_RESIZE
00700 if ( vect_size(Na)!=20 ) resize( Na, 20 );
00701 #elif EXPLICIT_BOUNDS_CHECK
00702 if ( vect_size(Na)!=20 ) ErrorMessage("shape_hexa20","Na must be of dimension 20");
00703 #endif
00704 Na[0] = 0.125*(1-xi)*(1-eta)*(1-zeta)*(-xi-eta-zeta-2);
00705 Na[1] = 0.25*(1-xi)*(1-eta)*(1-zeta*zeta);
00706 Na[2] = 0.125*(1-xi)*(1-eta)*(1+zeta)*(-xi-eta+zeta-2);
00707 Na[3] = 0.25*(1-xi*xi)*(1-eta)*(1+zeta);
00708 Na[4] = 0.125*(1+xi)*(1-eta)*(1+zeta)*(xi-eta+zeta-2);
00709 Na[5] = 0.25*(1+xi)*(1-eta)*(1-zeta*zeta);
00710 Na[6] = 0.125*(1+xi)*(1-eta)*(1-zeta)*(xi-eta-zeta-2);
00711 Na[7] = 0.25*(1-xi*xi)*(1-eta)*(1-zeta);
00712 Na[8] = 0.25*(1-xi)*(1-eta*eta)*(1-zeta);
00713 Na[9] = 0.25*(1-xi)*(1-eta*eta)*(1+zeta);
00714 Na[10] = 0.25*(1+xi)*(1-eta*eta)*(1+zeta);
00715 Na[11] = 0.25*(1+xi)*(1-eta*eta)*(1-zeta);
00716 Na[12] = 0.125*(1-xi)*(1+eta)*(1-zeta)*(-xi+eta-zeta-2);
00717 Na[13] = 0.25*(1-xi)*(1+eta)*(1-zeta*zeta);
00718 Na[14] = 0.125*(1-xi)*(1+eta)*(1+zeta)*(-xi+eta+zeta-2);
00719 Na[15] = 0.25*(1-xi*xi)*(1+eta)*(1+zeta);
00720 Na[16] = 0.125*(1+xi)*(1+eta)*(1+zeta)*(+xi+eta+zeta-2);
00721 Na[17] = 0.25*(1+xi)*(1+eta)*(1-zeta*zeta);
00722 Na[18] = 0.125*(1+xi)*(1+eta)*(1-zeta)*(xi+eta-zeta-2);
00723 Na[19] = 0.25*(1-xi*xi)*(1+eta)*(1-zeta);
00724 }
00725
00737 void dshape_hexa20( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00738 {
00739 #ifdef ALLOW_DYNAMIC_RESIZE
00740 if ( mat_nrows(dNa)!=20 || mat_ncols(dNa)!=3 ) resize( dNa, 20, 3 );
00741 #elif EXPLICIT_BOUNDS_CHECK
00742 if ( mat_nrows(dNa)!=20 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_hexa20","dNa must be of dimension 20 by 3");
00743 #endif
00744
00745 dNa(0,0)=-0.125*(1-eta)*(1-zeta)*(-zeta-xi-eta-2)-0.125*(1-eta)*(1-xi)*(1-zeta);
00746 dNa(0,1)=-0.125*(1-xi)*(1-zeta)*(-zeta-xi-eta-2)-0.125*(1-eta)*(1-xi)*(1-zeta);
00747 dNa(0,2)=-0.125*(1-eta)*(1-xi)*(-zeta-xi-eta-2) -0.125*(1-eta)*(1-xi)*(1-zeta);
00748 dNa(1,0)=-0.25*(1-eta)*(1-zeta*zeta);
00749 dNa(1,1)=-0.25*(1-xi)*(1-zeta*zeta);
00750 dNa(1,2)=-0.5*(1-eta)*(1-xi)*zeta;
00751 dNa(2,0)=-0.125*(1-eta)*(zeta+1)*(zeta-xi-eta-2)-0.125*(1-eta)*(1-xi)*(zeta+1);
00752 dNa(2,1)=-0.125*(1-xi)*(zeta+1)*(zeta-xi-eta-2)-0.125*(1-eta)*(1-xi)*(zeta+1);
00753 dNa(2,2)= 0.125*(1-eta)*(1-xi)*(zeta-xi-eta-2)+0.125*(1-eta)*(1-xi)*(zeta+1);
00754 dNa(3,0)=-0.5*(1-eta)*xi*(zeta+1);
00755 dNa(3,1)=-0.25*(1-xi*xi )*(zeta+1);
00756 dNa(3,2)= 0.25*(1-eta)*(1-xi*xi);
00757 dNa(4,0)= 0.125*(1-eta)*(zeta+1)*(zeta+xi-eta-2)+0.125*(1-eta)*(xi+1)*(zeta+1);
00758 dNa(4,1)= -0.125*(xi+1)*(zeta+1)*(zeta+xi-eta-2)-0.125*(1-eta)*(xi+1)*(zeta+1);
00759 dNa(4,2)= 0.125*(1-eta)*(xi+1)*(zeta+xi-eta-2)+0.125*(1-eta)*(xi+1)*(zeta+1);
00760 dNa(5,0)= 0.25*(1-eta)*(1-zeta*zeta);
00761 dNa(5,1)=-0.25*(xi+1)*(1-zeta*zeta);
00762 dNa(5,2)=-0.5*(1-eta)*(xi+1)*zeta;
00763 dNa(6,0)= 0.125*(1-eta)*(1-zeta)*(-zeta+xi-eta-2)+0.125*(1-eta)*(xi+1)*(1-zeta);
00764 dNa(6,1)=-0.125*(xi+1)*(1-zeta)*(-zeta+xi-eta-2)-0.125*(1-eta)*(xi+1)*(1-zeta);
00765 dNa(6,2)=-0.125*(1-eta)*(xi+1)*(-zeta+xi-eta-2)-0.125*(1-eta)*(xi+1)*(1-zeta);
00766 dNa(7,0)=-0.5*(1-eta)*xi*(1-zeta);
00767 dNa(7,1)=-0.25*(1-xi*xi)*(1-zeta);
00768 dNa(7,2)=-0.25*(1-eta)*(1-xi*xi);
00769 dNa(8,0)=-0.25*(1-eta )*(1-zeta);
00770 dNa(8,1)=-0.5*eta*(1-xi)*(1-zeta);
00771 dNa(8,2)=-0.25*(1-eta*eta )*(1-xi) ;
00772 dNa(9,0)=-0.25*(1-eta*eta)*(zeta+1);
00773 dNa(9,1)=-0.5*eta*(1-xi)*(zeta+1);
00774 dNa(9,2)= 0.25*(1-eta*eta)*(1-xi);
00775 dNa(10,0)= 0.25*(1-eta*eta)*(zeta+1);
00776 dNa(10,1)=-0.5*eta*(xi+1)*(zeta+1);
00777 dNa(10,2)= 0.25*(1-eta*eta)*(xi+1);
00778 dNa(11,0)= 0.25*(1-eta*eta)*(1-zeta);
00779 dNa(11,1)=-0.5*eta*(xi+1)*(1-zeta);
00780 dNa(11,2)=-0.25*(1-eta*eta)*(xi+1) ;
00781 dNa(12,0)=-0.125*(eta+1)*(1-zeta)*(-zeta-xi+eta-2)-0.125*(eta+1)*(1-xi)*(1-zeta);
00782 dNa(12,1)= 0.125*(1-xi)*(1-zeta)*(-zeta-xi+eta-2)+0.125*(eta+1)*(1-xi)*(1-zeta);
00783 dNa(12,2)=-0.125*(eta+1)*(1-xi)*(-zeta-xi+eta-2)-0.125*(eta+1)*(1-xi)*(1-zeta);
00784 dNa(13,0)=-0.25*(eta+1)*(1-zeta*zeta);
00785 dNa(13,1)= 0.25*(1-xi)*(1-zeta*zeta);
00786 dNa(13,2)=-0.5*(eta+1)*(1-xi)*zeta;
00787 dNa(14,0)=-0.125*(eta+1)*(zeta+1)*(zeta-xi+eta-2)-0.125*(eta+1)*(1-xi)*(zeta+1);
00788 dNa(14,1)= 0.125*(1-xi)*(zeta+1)*(zeta-xi+eta-2)+0.125*(eta+1)*(1-xi)*(zeta+1);
00789 dNa(14,2)= 0.125*(eta+1)*(1-xi)*(zeta-xi+eta-2)+0.125*(eta+1)*(1-xi)*(zeta+1);
00790 dNa(15,0)=-0.5*(eta+1)*xi*(zeta+1);
00791 dNa(15,1)= 0.25*(1-xi*xi)*(zeta+1);
00792 dNa(15,2)= 0.25*(eta+1)*(1-xi*xi);
00793 dNa(16,0)= 0.125*(eta+1)*(zeta+1)*(zeta+xi+eta-2)+0.125*(eta+1)*(xi+1)*(zeta+1);
00794 dNa(16,1)= 0.125*(xi+1)*(zeta+1)*(zeta+xi+eta-2)+0.125*(eta+1)*(xi+1)*(zeta+1);
00795 dNa(16,2)= 0.125*(eta+1)*(xi+1)*(zeta+xi+eta-2)+0.125*(eta+1)*(xi+1)*(zeta+1);
00796 dNa(17,0)= 0.25*(eta+1)*(1-zeta);
00797 dNa(17,1)= 0.25*(xi+1)*(1-zeta*zeta);
00798 dNa(17,2)=-0.5*(eta+1)*(xi+1)*zeta;
00799 dNa(18,0)= 0.125*(eta+1)*(1-zeta)*(-zeta+xi+eta-2)+0.125*(eta+1)*(xi+1)*(1-zeta);
00800 dNa(18,1)= 0.125*(xi+1)*(1-zeta)*(-zeta+xi+eta-2)+0.125*(eta+1)*(xi+1)*(1-zeta);
00801 dNa(18,2)=-0.125*(eta+1)*(xi+1)*(-zeta+xi+eta-2)-0.125*(eta+1)*(xi+1)*(1-zeta);
00802 dNa(19,0)=-0.5*(eta+1)*xi*(1-zeta);
00803 dNa(19,1)= 0.25*(1-xi*xi)*(1-zeta);
00804 dNa(19,2)=-0.25*(eta+1)*(1-xi*xi);
00805
00806 }
00807
00818 void shape_hexa27( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00819 {
00820 #ifdef ALLOW_DYNAMIC_RESIZE
00821 if ( vect_size(Na)!=27 ) resize( Na, 27 );
00822 #elif EXPLICIT_BOUNDS_CHECK
00823 if ( vect_size(Na)!=27 ) ErrorMessage("shape_hexa27","Na must be of dimension 27");
00824 #endif
00825
00826 WarningMessage("shape_hexa27","not yet implemented");
00827 }
00828
00840 void dshape_hexa27( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
00841 {
00842 #ifdef ALLOW_DYNAMIC_RESIZE
00843 if ( mat_nrows(dNa)!=27 || mat_ncols(dNa)!=3 ) resize( dNa, 27, 3 );
00844 #elif EXPLICIT_BOUNDS_CHECK
00845 if ( mat_nrows(dNa)!=27 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_hexa27","dNa must be of dimension 27 by 3");
00846 #endif
00847
00848 WarningMessage("dshape_hexa27","not yet implemented");
00849 }
00850
00861 void shape_prism6( nArray &Na, const Numeric &xi=0.333333333333, const Numeric &eta=0.333333333333333,
00862 const Numeric &zeta=0.0 )
00863 {
00864 #ifdef ALLOW_DYNAMIC_RESIZE
00865 if ( vect_size(Na)!=6 ) resize( Na, 6 );
00866 #elif EXPLICIT_BOUNDS_CHECK
00867 if ( vect_size(Na)!=6 ) ErrorMessage("shape_prism6","Na must be of dimension 6");
00868 #endif
00869 Na[0]=(1-xi-eta)*(1-zeta);
00870 Na[1]=xi*(1-zeta);
00871 Na[2]=eta*(1-zeta);
00872 Na[3]=(1-xi-eta)*zeta;
00873 Na[4]=xi*zeta;
00874 Na[5]=eta*zeta;
00875 }
00876
00888 void dshape_prism6( nMatrix &dNa, const Numeric &xi=0.333333333333, const Numeric &eta=0.3333333333333,
00889 const Numeric &zeta=0.0 )
00890 {
00891 #ifdef ALLOW_DYNAMIC_RESIZE
00892 if ( mat_nrows(dNa)!=6 || mat_ncols(dNa)!=3 ) resize( dNa, 6, 3 );
00893 #elif EXPLICIT_BOUNDS_CHECK
00894 if ( mat_nrows(dNa)!=6 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_prism6","dNa must be of dimension 6 by 3");
00895 #endif
00896
00897 dNa(0,0)= zeta-1.0; dNa(0,1)= zeta-1.0; dNa(0,2)= xi+eta-1.0;
00898 dNa(1,0)= 1.0-zeta; dNa(1,1)= 0.0; dNa(1,2)= -xi;
00899 dNa(2,0)= 0.0; dNa(2,1)= 1.0-zeta; dNa(2,2)= -eta ;
00900 dNa(3,0)= -zeta; dNa(3,1)= -zeta; dNa(3,2)= 1-xi-eta;
00901 dNa(4,0)= zeta; dNa(4,1)= 0.0; dNa(4,2)= xi ;
00902 dNa(5,0)= 0.0; dNa(5,1)= zeta; dNa(5,2)= eta;
00903 }
00904
00915 void shape_prism14( nArray &Na, const Numeric &xi=0.333333333333, const Numeric &eta=0.333333333333333,
00916 const Numeric &zeta=0.0 )
00917 {
00918 #ifdef ALLOW_DYNAMIC_RESIZE
00919 if ( vect_size(Na)!=12 ) resize( Na, 12 );
00920 #elif EXPLICIT_BOUNDS_CHECK
00921 if ( vect_size(Na)!=12 ) ErrorMessage("shape_prism12","Na must be of dimension 12");
00922 #endif
00923
00924 WarningMessage("shape_prism12","not yet implemented");
00925 }
00926
00938 void dshape_prism14( nMatrix &dNa, const Numeric &xi=0.333333333333, const Numeric &eta=0.3333333333333,
00939 const Numeric &zeta=0.0 )
00940 {
00941 #ifdef ALLOW_DYNAMIC_RESIZE
00942 if ( mat_nrows(dNa)!=12 || mat_ncols(dNa)!=3 ) resize( dNa, 12, 3 );
00943 #elif EXPLICIT_BOUNDS_CHECK
00944 if ( mat_nrows(dNa)!=12 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_prism12","dNa must be of dimension 12 by 3");
00945 #endif
00946
00947 WarningMessage("dshape_prism12","not yet implemented");
00948 }
00949
00959 void shape_prism15( nArray &Na, const Numeric &xi=0.333333333333, const Numeric &eta=0.333333333333333,
00960 const Numeric &zeta=0.0 )
00961 {
00962 #ifdef ALLOW_DYNAMIC_RESIZE
00963 if ( vect_size(Na)!=15 ) resize( Na, 15 );
00964 #elif EXPLICIT_BOUNDS_CHECK
00965 if ( vect_size(Na)!=15 ) ErrorMessage("shape_prism15","Na must be of dimension 15");
00966 #endif
00967 WarningMessage("shape_prism15","not yet implemented");
00968 }
00969
00978 void dshape_prism15( nMatrix &dNa, const Numeric &xi=0.333333333333, const Numeric &eta=0.3333333333333,
00979 const Numeric &zeta=0.0 )
00980 {
00981 #ifdef ALLOW_DYNAMIC_RESIZE
00982 if ( mat_nrows(dNa)!=15 || mat_ncols(dNa)!=3 ) resize( dNa, 15, 3 );
00983 #elif EXPLICIT_BOUNDS_CHECK
00984 if ( mat_nrows(dNa)!=15 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_prism15","dNa must be of dimension 15 by 3");
00985 #endif
00986
00987 WarningMessage("dshape_prism15","not yet implemented");
00988 }
00989
00999 void shape_prism18( nArray &Na, const Numeric &xi=0.333333333333, const Numeric &eta=0.333333333333333,
01000 const Numeric &zeta=0.0 )
01001 {
01002 #ifdef ALLOW_DYNAMIC_RESIZE
01003 if ( vect_size(Na)!=18 ) resize( Na, 18 );
01004 #elif EXPLICIT_BOUNDS_CHECK
01005 if ( vect_size(Na)!=18 ) ErrorMessage("shape_prism18","Na must be of dimension 18");
01006 #endif
01007 Na[0] = 2*(1-3*(xi+eta)+4*xi*eta+2*(xi*xi+eta*eta))*(1-zeta)*(0.5-zeta);
01008 Na[1] = 2*xi*(2*xi-1)*(1-zeta)*(0.5-zeta);
01009 Na[2] = 2*eta*(2*eta-1)*(1-zeta)*(0.5-zeta);
01010 Na[3] = 2*(1-3*(xi+eta)+4*xi*eta+2*(xi*xi+eta*eta))*zeta*(0.5-zeta);
01011 Na[4] = 2*xi*(2*xi-1)*zeta*(0.5-zeta);
01012 Na[5] = 2*eta*(2*eta-1)*zeta*(0.5-zeta);
01013 Na[6] = 8*xi*(1-xi-eta)*(1-zeta)*(0.5-zeta);
01014 Na[7] = 8*xi*eta*(1-zeta)*(0.5-zeta);
01015 Na[8] = 8*eta*(1-xi-eta)*(1-zeta)*(0.5-zeta);
01016 Na[9] = 4*(1-3*(xi+eta)+4*xi*eta+2*(xi*xi+eta*eta))*zeta*(1-zeta);
01017 Na[10] = 4*xi*(2*xi-1)*zeta*(1-zeta);
01018 Na[11] = 4*eta*(2*eta-1)*zeta*(1-zeta);
01019 Na[12] = 16*xi*(1-xi-eta)*zeta*(1-zeta);
01020 Na[13] = 16*xi*eta*zeta*(1-zeta);
01021 Na[14] = 16*eta*(1-xi-eta)*zeta*(1-zeta);
01022 Na[15] = 8*xi*(1-xi-eta)*zeta*(0.5-zeta);
01023 Na[16] = 8*xi*eta*zeta*(0.5-zeta);
01024 Na[17] = 8*eta*(1-xi-eta)*zeta*(0.5-zeta);
01025 }
01026
01038 void dshape_prism18( nMatrix &dNa, const Numeric &xi=0.333333333333, const Numeric &eta=0.3333333333333,
01039 const Numeric &zeta=0.0 )
01040 {
01041 #ifdef ALLOW_DYNAMIC_RESIZE
01042 if ( mat_nrows(dNa)!=18 || mat_ncols(dNa)!=3 ) resize( dNa, 18, 3 );
01043 #elif EXPLICIT_BOUNDS_CHECK
01044 if ( mat_nrows(dNa)!=18 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_prism18","dNa must be of dimension 18 by 3");
01045 #endif
01046
01047 dNa( 0 ,0)= 2 *(4 *xi + 4* eta - 3)*(0.5 - zeta)*(1 - zeta);
01048 dNa( 0 ,1)= 2 *(4 *xi + 4 *eta - 3)*(0.5 - zeta)*(1 - zeta);
01049 dNa( 0 ,2)= -2*(2*(xi*xi+eta*eta)-3*(xi+eta)+4* eta*xi+1)*(1-zeta)-2*(2*(xi*xi+eta*eta)
01050 -3*(xi+eta+4*eta*xi+1))*(0.5-zeta) ;
01051 dNa( 1 ,0)= 2 *(2* xi - 1)*(0.5 - zeta)*(1 - zeta) + 4 *xi* (0.5 - zeta)*(1 - zeta) ;
01052 dNa( 1 ,1)= 0.0 ;
01053 dNa( 1 ,2)= - 2 *xi* (2 *xi - 1)*(1 - zeta) - 2 *xi* (2* xi - 1)*(0.5 - zeta) ;
01054 dNa( 2 ,0)= 0.0 ;
01055 dNa( 2 ,1)= 2* (2 *eta - 1)*(0.5 - zeta)*(1 - zeta)+ 4 *eta *(0.5 - zeta)*(1 - zeta) ;
01056 dNa( 2 ,2)= - 2 *eta *(2* eta - 1)*(1 - zeta) - 2* eta *(2*eta - 1)*(0.5 - zeta) ;
01057 dNa( 3 ,0)= 2 *(4* xi + 4* eta - 3)*(0.5 - zeta)* zeta ;
01058 dNa( 3 ,1)= 2 *(4* xi + 4 *eta - 3)*(0.5 - zeta)* zeta ;
01059 dNa( 3 ,2)= 2*(2*(xi*xi+eta*eta)-3*(xi+eta)+4*eta*xi+1)*(0.5-zeta)-2*(2*(xi*xi+eta*eta)
01060 -3*(xi+eta)+4*eta*xi+1)*zeta ;
01061 dNa( 4 ,0)= 2*(2* xi - 1)*(0.5 - zeta)* zeta + 4* xi* (0.5 - zeta)*zeta ;
01062 dNa( 4 ,1)= 0.0 ;
01063 dNa( 4 ,2)= 2* xi* (2* xi - 1)*(0.5 - zeta) - 2 *xi* (2 *xi - 1)* zeta ;
01064 dNa( 5 ,0)= 0.0 ;
01065 dNa( 5 ,1)= 2 *(2*eta - 1)*(0.5 - zeta)* zeta + 4 *eta* (0.5 - zeta)* zeta ;
01066 dNa( 5 ,2)= 2* eta *(2 *eta - 1)*(0.5 - zeta) - 2* eta* (2 *eta - 1) *zeta ;
01067 dNa( 6 ,0)= 8 *(- xi - eta + 1)*(0.5 - zeta)*(1 - zeta)- 8 *xi *(0.5 - zeta)*(1 - zeta) ;
01068 dNa( 6 ,1)= - 8 *xi *(0.5 - zeta)*(1 - zeta) ;
01069 dNa( 6 ,2)= - 8* (- xi - eta + 1)* xi* (1 - zeta) - 8 *(- xi - eta + 1) *xi* (0.5 - zeta);
01070 dNa( 7 ,0)= 8* eta *(0.5 - zeta)*(1 - zeta) ;
01071 dNa( 7 ,1)= 8* xi *(0.5 - zeta)*(1 - zeta) ;
01072 dNa( 7 ,2)= - 8 *eta* xi* (1 - zeta) - 8 *eta* xi* (0.5 - zeta) ;
01073 dNa( 8 ,0)= - 8 *eta* (0.5 - zeta)*(1 - zeta) ;
01074 dNa( 8 ,1)= 8 *(- xi - eta + 1)*(0.5 - zeta)*(1 - zeta) - 8 *eta *(0.5 - zeta)*(1 - zeta);
01075 dNa( 8 ,2)= - 8 *eta* (- xi - eta + 1)*(1 - zeta) - 8* eta* (- xi - eta + 1)*(0.5 - zeta) ;
01076 dNa( 9 ,0)= 4* (4* xi + 4* eta - 3)*(1 - zeta) *zeta ;
01077 dNa( 9 ,1)= 4* (4 *xi + 4 *eta - 3)*(1 - zeta) *zeta ;
01078 dNa( 9 ,2)= 4* (2* (xi*xi + eta*eta ) - 3* (xi + eta) + 4 *eta *xi + 1)*(1 - zeta)
01079 - 4 *(2* (xi*xi + eta*eta ) - 3 *(xi + eta) + 4* eta *xi + 1)* zeta ;
01080 dNa( 10 ,0)= 4* (2* xi - 1)*(1 - zeta)* zeta + 8 *xi *(1 - zeta) *zeta ;
01081 dNa( 10 ,1)= 0.0 ;
01082 dNa( 10 ,2)= 4* xi *(2* xi - 1)*(1 - zeta) - 4* xi* (2* xi - 1)* zeta ;
01083 dNa( 11 ,0)= 0.0 ;
01084 dNa( 11 ,1)= 4 *(2 *eta - 1)*(1 - zeta)* zeta + 8 *eta* (1 - zeta) *zeta ;
01085 dNa( 11 ,2)= 4* eta *(2 *eta - 1)*(1 - zeta) - 4 *eta* (2* eta - 1) *zeta ;
01086 dNa( 12 ,0)= 16* (- xi - eta + 1)*(1 - zeta) *zeta - 16* xi* (1 - zeta)* zeta ;
01087 dNa( 12 ,1)= - 16 *xi* (1 - zeta) *zeta ;
01088 dNa( 12 ,2)= 16* (- xi - eta + 1)* xi* (1 - zeta) - 16* (- xi - eta + 1)* xi *zeta ;
01089 dNa( 13 ,0)= 16* eta* (1 - zeta) *zeta ;
01090 dNa( 13 ,1)= 16 *xi* (1 - zeta)* zeta ;
01091 dNa( 13 ,2)= 16 *eta* xi* (1 - zeta) - 16* eta* xi *zeta ;
01092 dNa( 14 ,0)= - 16* eta* (1 - zeta)* zeta ;
01093 dNa( 14 ,1)= 16 *(- xi - eta + 1)*(1 - zeta)* zeta - 16 *eta *(1 - zeta)* zeta ;
01094 dNa( 14 ,2)= 16 *eta* (- xi - eta + 1)*(1 - zeta) - 16* eta* (- xi - eta + 1) *zeta ;
01095 dNa( 15 ,0)= 8* (- xi - eta + 1)*(0.5 - zeta) *zeta - 8* xi* (0.5 - zeta) *zeta ;
01096 dNa( 15 ,1)= - 8 *xi* (0.5 - zeta) *zeta ;
01097 dNa( 15 ,2)= 8 *(- xi - eta + 1)* xi *(0.5 - zeta) - 8* (- xi - eta + 1) *xi *zeta ;
01098 dNa( 16 ,0)= 8 *eta *(0.5 - zeta) *zeta ;
01099 dNa( 16 ,1)= 8 *xi* (0.5 - zeta) *zeta ;
01100 dNa( 16 ,2)= 8 *eta* xi* (0.5 - zeta) - 8* eta* xi* zeta ;
01101 dNa( 17 ,0)= - 8 *eta* (0.5 - zeta) *zeta ;
01102 dNa( 17 ,1)= 8* (- xi - eta + 1)*(0.5 - zeta) *zeta - 8* eta* (0.5 - zeta) *zeta ;
01103 dNa( 17 ,2)= 8 *eta *(- xi - eta + 1)*(0.5 - zeta) - 8 *eta* (- xi - eta + 1) *zeta ;
01104 }
01105
01106
01107
01119 void shape_pyramid5( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01120 {
01121 #ifdef ALLOW_DYNAMIC_RESIZE
01122 if ( vect_size(Na)!=5 ) resize( Na, 5 );
01123 #elif EXPLICIT_BOUNDS_CHECK
01124 if ( vect_size(Na)!=5 ) ErrorMessage("shape_pyramid5","Na must be of dimension 5");
01125 #endif
01126
01127 WarningMessage("shape_pyramid5","not yet implemented");
01128 }
01129
01141 void dshape_pyramid5( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01142 {
01143 #ifdef ALLOW_DYNAMIC_RESIZE
01144 if ( mat_nrows(dNa)!=5 || mat_ncols(dNa)!=3 ) resize( dNa, 5, 3 );
01145 #elif EXPLICIT_BOUNDS_CHECK
01146 if ( mat_nrows(dNa)!=5 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_pyramid5","dNa must be of dimension 5 by 3");
01147 #endif
01148
01149 WarningMessage("dshape_pyramid5","not yet implemented");
01150 }
01151
01162 void shape_pyramid13( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01163 {
01164 #ifdef ALLOW_DYNAMIC_RESIZE
01165 if ( vect_size(Na)!=13 ) resize( Na, 13 );
01166 #elif EXPLICIT_BOUNDS_CHECK
01167 if ( vect_size(Na)!=13 ) ErrorMessage("shape_pyramid13","Na must be of dimension 13");
01168 #endif
01169
01170 WarningMessage("shape_pyramid13","not yet implemented");
01171 }
01172
01183 void dshape_pyramid13( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01184 {
01185 #ifdef ALLOW_DYNAMIC_RESIZE
01186 if ( mat_nrows(dNa)!=13 || mat_ncols(dNa)!=3 ) resize( dNa, 13, 3 );
01187 #elif EXPLICIT_BOUNDS_CHECK
01188 if ( mat_nrows(dNa)!=13 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_pyramid13","dNa must be of dimension 13 by 3");
01189 #endif
01190
01191 WarningMessage("dshape_pyramid13","not yet implemented");
01192 }
01193
01204 void shape_pyramid14( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01205 {
01206 #ifdef ALLOW_DYNAMIC_RESIZE
01207 if ( vect_size(Na)!=14 ) resize( Na, 14 );
01208 #elif EXPLICIT_BOUNDS_CHECK
01209 if ( vect_size(Na)!=14 ) ErrorMessage("shape_pyramid14","Na must be of dimension 14");
01210 #endif
01211
01212 WarningMessage("shape_pyramid14","not yet implemented");
01213 }
01214
01226 void dshape_pyramid14( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01227 {
01228 #ifdef ALLOW_DYNAMIC_RESIZE
01229 if ( mat_nrows(dNa)!=14 || mat_ncols(dNa)!=3 ) resize( dNa, 14, 3 );
01230 #elif EXPLICIT_BOUNDS_CHECK
01231 if ( mat_nrows(dNa)!=14 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_pyramid14","dNa must be of dimension 14 by 3");
01232 #endif
01233
01234 WarningMessage("dshape_pyramid14","not yet implemented");
01235 }
01236
01247 void shape_point1( nArray &Na, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.0 )
01248 {
01249 #ifdef ALLOW_DYNAMIC_RESIZE
01250 if ( vect_size(Na)!=1 ) resize( Na, 1 );
01251 #elif EXPLICIT_BOUNDS_CHECK
01252 if ( vect_size(Na)!=11 ) ErrorMessage("shape_point1","Na must be of dimension 1");
01253 #endif
01254
01255 Na[0]=1.0;
01256 }
01257
01266 void dshape_point1( nMatrix &dNa, const Numeric &xi=0.0, const Numeric &eta=0.0, const Numeric &zeta=0.125 )
01267 {
01268 #ifdef ALLOW_DYNAMIC_RESIZE
01269 if ( mat_nrows(dNa)!=1 || mat_ncols(dNa)!=3 ) resize( dNa, 1, 3 );
01270 #elif EXPLICIT_BOUNDS_CHECK
01271 if ( mat_nrows(dNa)!=1 || mat_ncols(dNa)!=3 ) ErrorMessage("dshape_point1","dNa must be of dimension 1 by 3");
01272 #endif
01273
01274 dNa(0,0)=0.0; dNa(0,0)=0.0; dNa(0,0)=0.0;
01275
01276 }
01277
01278
01279 }
01280
01281 #endif