52 libmesh_assert_less (i, 8);
56 const Real eta = p(1);
57 const Real zeta = p(2);
60 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
61 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
62 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
73 libmesh_assert_less (i, 4);
76 const Real zeta1 = p(0);
77 const Real zeta2 = p(1);
78 const Real zeta3 = p(2);
79 const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
96 libmesh_error_msg(
"Invalid i = " << i);
105 libmesh_assert_less (i, 6);
110 Point p2d(p(0),p(1));
114 static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
115 static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
124 libmesh_assert_less (i, 5);
126 const Real xi = p(0);
127 const Real eta = p(1);
128 const Real zeta = p(2);
129 const Real eps = 1.e-35;
134 return .25*(zeta + xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
137 return .25*(zeta - xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
140 return .25*(zeta - xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
143 return .25*(zeta + xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
149 libmesh_error_msg(
"Invalid i = " << i);
155 libmesh_error_msg(
"ERROR: Unsupported 3D element type!: " << type);
169 libmesh_assert_less (i, 20);
171 const Real xi = p(0);
172 const Real eta = p(1);
173 const Real zeta = p(2);
177 const Real x = .5*(xi + 1.);
178 const Real y = .5*(eta + 1.);
179 const Real z = .5*(zeta + 1.);
184 return (1. - x)*(1. - y)*(1. - z)*(1. - 2.*x - 2.*y - 2.*z);
187 return x*(1. - y)*(1. - z)*(2.*x - 2.*y - 2.*z - 1.);
190 return x*y*(1. - z)*(2.*x + 2.*y - 2.*z - 3.);
193 return (1. - x)*y*(1. - z)*(2.*y - 2.*x - 2.*z - 1.);
196 return (1. - x)*(1. - y)*z*(2.*z - 2.*x - 2.*y - 1.);
199 return x*(1. - y)*z*(2.*x - 2.*y + 2.*z - 3.);
202 return x*y*z*(2.*x + 2.*y + 2.*z - 5.);
205 return (1. - x)*y*z*(2.*y - 2.*x + 2.*z - 3.);
208 return 4.*x*(1. - x)*(1. - y)*(1. - z);
211 return 4.*x*y*(1. - y)*(1. - z);
214 return 4.*x*(1. - x)*y*(1. - z);
217 return 4.*(1. - x)*y*(1. - y)*(1. - z);
220 return 4.*(1. - x)*(1. - y)*z*(1. - z);
223 return 4.*x*(1. - y)*z*(1. - z);
226 return 4.*x*y*z*(1. - z);
229 return 4.*(1. - x)*y*z*(1. - z);
232 return 4.*x*(1. - x)*(1. - y)*z;
235 return 4.*x*y*(1. - y)*z;
238 return 4.*x*(1. - x)*y*z;
241 return 4.*(1. - x)*y*(1. - y)*z;
244 libmesh_error_msg(
"Invalid i = " << i);
251 libmesh_assert_less (i, 27);
254 const Real xi = p(0);
255 const Real eta = p(1);
256 const Real zeta = p(2);
262 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
263 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
264 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
274 libmesh_assert_less (i, 10);
277 const Real zeta1 = p(0);
278 const Real zeta2 = p(1);
279 const Real zeta3 = p(2);
280 const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
285 return zeta0*(2.*zeta0 - 1.);
288 return zeta1*(2.*zeta1 - 1.);
291 return zeta2*(2.*zeta2 - 1.);
294 return zeta3*(2.*zeta3 - 1.);
297 return 4.*zeta0*zeta1;
300 return 4.*zeta1*zeta2;
303 return 4.*zeta2*zeta0;
306 return 4.*zeta0*zeta3;
309 return 4.*zeta1*zeta3;
312 return 4.*zeta2*zeta3;
315 libmesh_error_msg(
"Invalid i = " << i);
322 libmesh_assert_less (i, 18);
327 Point p2d(p(0),p(1));
331 static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
332 static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
340 libmesh_error_msg(
"ERROR: Unsupported 3D element type!: " << type);
347 libmesh_error_msg(
"ERROR: Unsupported 3D FE order!: " << order);
358 const unsigned int i,
361 libmesh_assert(elem);
373 const unsigned int i,
374 const unsigned int j,
379 libmesh_assert_less (j, 3);
393 libmesh_assert_less (i, 8);
396 const Real xi = p(0);
397 const Real eta = p(1);
398 const Real zeta = p(2);
400 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
401 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
402 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
422 libmesh_error_msg(
"Invalid j = " << j);
430 libmesh_assert_less (i, 4);
433 const Real dzeta0dxi = -1.;
434 const Real dzeta1dxi = 1.;
435 const Real dzeta2dxi = 0.;
436 const Real dzeta3dxi = 0.;
438 const Real dzeta0deta = -1.;
439 const Real dzeta1deta = 0.;
440 const Real dzeta2deta = 1.;
441 const Real dzeta3deta = 0.;
443 const Real dzeta0dzeta = -1.;
444 const Real dzeta1dzeta = 0.;
445 const Real dzeta2dzeta = 0.;
446 const Real dzeta3dzeta = 1.;
468 libmesh_error_msg(
"Invalid i = " << i);
490 libmesh_error_msg(
"Invalid i = " << i);
512 libmesh_error_msg(
"Invalid i = " << i);
517 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
526 libmesh_assert_less (i, 6);
531 Point p2d(p(0),p(1));
535 static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
536 static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
556 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
563 libmesh_assert_less (i, 5);
565 const Real xi = p(0);
566 const Real eta = p(1);
567 const Real zeta = p(2);
568 const Real eps = 1.e-35;
577 return .25*(zeta + eta - 1.)/((1. - zeta) + eps);
580 return -.25*(zeta + eta - 1.)/((1. - zeta) + eps);
583 return -.25*(zeta - eta - 1.)/((1. - zeta) + eps);
586 return .25*(zeta - eta - 1.)/((1. - zeta) + eps);
592 libmesh_error_msg(
"Invalid i = " << i);
601 return .25*(zeta + xi - 1.)/((1. - zeta) + eps);
604 return .25*(zeta - xi - 1.)/((1. - zeta) + eps);
607 return -.25*(zeta - xi - 1.)/((1. - zeta) + eps);
610 return -.25*(zeta + xi - 1.)/((1. - zeta) + eps);
616 libmesh_error_msg(
"Invalid i = " << i);
629 return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
630 (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
631 ((1. - zeta)*(1. - zeta) + eps));
639 return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
640 (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
641 ((1. - zeta)*(1. - zeta) + eps));
649 return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
650 (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
651 ((1. - zeta)*(1. - zeta) + eps));
659 return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
660 (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
661 ((1. - zeta)*(1. - zeta) + eps));
668 libmesh_error_msg(
"Invalid i = " << i);
673 libmesh_error_msg(
"Invalid j = " << j);
679 libmesh_error_msg(
"ERROR: Unsupported 3D element type!: " << type);
693 libmesh_assert_less (i, 20);
695 const Real xi = p(0);
696 const Real eta = p(1);
697 const Real zeta = p(2);
701 const Real x = .5*(xi + 1.);
702 const Real y = .5*(eta + 1.);
703 const Real z = .5*(zeta + 1.);
715 return .5*(1. - y)*(1. - z)*((1. - x)*(-2.) +
716 (-1.)*(1. - 2.*x - 2.*y - 2.*z));
719 return .5*(1. - y)*(1. - z)*(x*(2.) +
720 (1.)*(2.*x - 2.*y - 2.*z - 1.));
723 return .5*y*(1. - z)*(x*(2.) +
724 (1.)*(2.*x + 2.*y - 2.*z - 3.));
727 return .5*y*(1. - z)*((1. - x)*(-2.) +
728 (-1.)*(2.*y - 2.*x - 2.*z - 1.));
731 return .5*(1. - y)*z*((1. - x)*(-2.) +
732 (-1.)*(2.*z - 2.*x - 2.*y - 1.));
735 return .5*(1. - y)*z*(x*(2.) +
736 (1.)*(2.*x - 2.*y + 2.*z - 3.));
739 return .5*y*z*(x*(2.) +
740 (1.)*(2.*x + 2.*y + 2.*z - 5.));
743 return .5*y*z*((1. - x)*(-2.) +
744 (-1.)*(2.*y - 2.*x + 2.*z - 3.));
747 return 2.*(1. - y)*(1. - z)*(1. - 2.*x);
750 return 2.*y*(1. - y)*(1. - z);
753 return 2.*y*(1. - z)*(1. - 2.*x);
756 return 2.*y*(1. - y)*(1. - z)*(-1.);
759 return 2.*(1. - y)*z*(1. - z)*(-1.);
762 return 2.*(1. - y)*z*(1. - z);
765 return 2.*y*z*(1. - z);
768 return 2.*y*z*(1. - z)*(-1.);
771 return 2.*(1. - y)*z*(1. - 2.*x);
774 return 2.*y*(1. - y)*z;
777 return 2.*y*z*(1. - 2.*x);
780 return 2.*y*(1. - y)*z*(-1.);
783 libmesh_error_msg(
"Invalid i = " << i);
792 return .5*(1. - x)*(1. - z)*((1. - y)*(-2.) +
793 (-1.)*(1. - 2.*x - 2.*y - 2.*z));
796 return .5*x*(1. - z)*((1. - y)*(-2.) +
797 (-1.)*(2.*x - 2.*y - 2.*z - 1.));
800 return .5*x*(1. - z)*(y*(2.) +
801 (1.)*(2.*x + 2.*y - 2.*z - 3.));
804 return .5*(1. - x)*(1. - z)*(y*(2.) +
805 (1.)*(2.*y - 2.*x - 2.*z - 1.));
808 return .5*(1. - x)*z*((1. - y)*(-2.) +
809 (-1.)*(2.*z - 2.*x - 2.*y - 1.));
812 return .5*x*z*((1. - y)*(-2.) +
813 (-1.)*(2.*x - 2.*y + 2.*z - 3.));
816 return .5*x*z*(y*(2.) +
817 (1.)*(2.*x + 2.*y + 2.*z - 5.));
820 return .5*(1. - x)*z*(y*(2.) +
821 (1.)*(2.*y - 2.*x + 2.*z - 3.));
824 return 2.*x*(1. - x)*(1. - z)*(-1.);
827 return 2.*x*(1. - z)*(1. - 2.*y);
830 return 2.*x*(1. - x)*(1. - z);
833 return 2.*(1. - x)*(1. - z)*(1. - 2.*y);
836 return 2.*(1. - x)*z*(1. - z)*(-1.);
839 return 2.*x*z*(1. - z)*(-1.);
842 return 2.*x*z*(1. - z);
845 return 2.*(1. - x)*z*(1. - z);
848 return 2.*x*(1. - x)*z*(-1.);
851 return 2.*x*z*(1. - 2.*y);
854 return 2.*x*(1. - x)*z;
857 return 2.*(1. - x)*z*(1. - 2.*y);
860 libmesh_error_msg(
"Invalid i = " << i);
869 return .5*(1. - x)*(1. - y)*((1. - z)*(-2.) +
870 (-1.)*(1. - 2.*x - 2.*y - 2.*z));
873 return .5*x*(1. - y)*((1. - z)*(-2.) +
874 (-1.)*(2.*x - 2.*y - 2.*z - 1.));
877 return .5*x*y*((1. - z)*(-2.) +
878 (-1.)*(2.*x + 2.*y - 2.*z - 3.));
881 return .5*(1. - x)*y*((1. - z)*(-2.) +
882 (-1.)*(2.*y - 2.*x - 2.*z - 1.));
885 return .5*(1. - x)*(1. - y)*(z*(2.) +
886 (1.)*(2.*z - 2.*x - 2.*y - 1.));
889 return .5*x*(1. - y)*(z*(2.) +
890 (1.)*(2.*x - 2.*y + 2.*z - 3.));
893 return .5*x*y*(z*(2.) +
894 (1.)*(2.*x + 2.*y + 2.*z - 5.));
897 return .5*(1. - x)*y*(z*(2.) +
898 (1.)*(2.*y - 2.*x + 2.*z - 3.));
901 return 2.*x*(1. - x)*(1. - y)*(-1.);
904 return 2.*x*y*(1. - y)*(-1.);
907 return 2.*x*(1. - x)*y*(-1.);
910 return 2.*(1. - x)*y*(1. - y)*(-1.);
913 return 2.*(1. - x)*(1. - y)*(1. - 2.*z);
916 return 2.*x*(1. - y)*(1. - 2.*z);
919 return 2.*x*y*(1. - 2.*z);
922 return 2.*(1. - x)*y*(1. - 2.*z);
925 return 2.*x*(1. - x)*(1. - y);
928 return 2.*x*y*(1. - y);
931 return 2.*x*(1. - x)*y;
934 return 2.*(1. - x)*y*(1. - y);
937 libmesh_error_msg(
"Invalid i = " << i);
941 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
948 libmesh_assert_less (i, 27);
951 const Real xi = p(0);
952 const Real eta = p(1);
953 const Real zeta = p(2);
959 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
960 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
961 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
981 libmesh_error_msg(
"Invalid j = " << j);
988 libmesh_assert_less (i, 10);
991 const Real zeta1 = p(0);
992 const Real zeta2 = p(1);
993 const Real zeta3 = p(2);
994 const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
996 const Real dzeta0dxi = -1.;
997 const Real dzeta1dxi = 1.;
998 const Real dzeta2dxi = 0.;
999 const Real dzeta3dxi = 0.;
1001 const Real dzeta0deta = -1.;
1002 const Real dzeta1deta = 0.;
1003 const Real dzeta2deta = 1.;
1004 const Real dzeta3deta = 0.;
1006 const Real dzeta0dzeta = -1.;
1007 const Real dzeta1dzeta = 0.;
1008 const Real dzeta2dzeta = 0.;
1009 const Real dzeta3dzeta = 1.;
1019 return (4.*zeta0 - 1.)*dzeta0dxi;
1022 return (4.*zeta1 - 1.)*dzeta1dxi;
1025 return (4.*zeta2 - 1.)*dzeta2dxi;
1028 return (4.*zeta3 - 1.)*dzeta3dxi;
1031 return 4.*(zeta0*dzeta1dxi + dzeta0dxi*zeta1);
1034 return 4.*(zeta1*dzeta2dxi + dzeta1dxi*zeta2);
1037 return 4.*(zeta0*dzeta2dxi + dzeta0dxi*zeta2);
1040 return 4.*(zeta0*dzeta3dxi + dzeta0dxi*zeta3);
1043 return 4.*(zeta1*dzeta3dxi + dzeta1dxi*zeta3);
1046 return 4.*(zeta2*dzeta3dxi + dzeta2dxi*zeta3);
1049 libmesh_error_msg(
"Invalid i = " << i);
1059 return (4.*zeta0 - 1.)*dzeta0deta;
1062 return (4.*zeta1 - 1.)*dzeta1deta;
1065 return (4.*zeta2 - 1.)*dzeta2deta;
1068 return (4.*zeta3 - 1.)*dzeta3deta;
1071 return 4.*(zeta0*dzeta1deta + dzeta0deta*zeta1);
1074 return 4.*(zeta1*dzeta2deta + dzeta1deta*zeta2);
1077 return 4.*(zeta0*dzeta2deta + dzeta0deta*zeta2);
1080 return 4.*(zeta0*dzeta3deta + dzeta0deta*zeta3);
1083 return 4.*(zeta1*dzeta3deta + dzeta1deta*zeta3);
1086 return 4.*(zeta2*dzeta3deta + dzeta2deta*zeta3);
1089 libmesh_error_msg(
"Invalid i = " << i);
1099 return (4.*zeta0 - 1.)*dzeta0dzeta;
1102 return (4.*zeta1 - 1.)*dzeta1dzeta;
1105 return (4.*zeta2 - 1.)*dzeta2dzeta;
1108 return (4.*zeta3 - 1.)*dzeta3dzeta;
1111 return 4.*(zeta0*dzeta1dzeta + dzeta0dzeta*zeta1);
1114 return 4.*(zeta1*dzeta2dzeta + dzeta1dzeta*zeta2);
1117 return 4.*(zeta0*dzeta2dzeta + dzeta0dzeta*zeta2);
1120 return 4.*(zeta0*dzeta3dzeta + dzeta0dzeta*zeta3);
1123 return 4.*(zeta1*dzeta3dzeta + dzeta1dzeta*zeta3);
1126 return 4.*(zeta2*dzeta3dzeta + dzeta2dzeta*zeta3);
1129 libmesh_error_msg(
"Invalid i = " << i);
1134 libmesh_error_msg(
"Invalid j = " << j);
1143 libmesh_assert_less (i, 18);
1148 Point p2d(p(0),p(1));
1152 static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1153 static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1173 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
1179 libmesh_error_msg(
"ERROR: Unsupported 3D element type!: " << type);
1186 libmesh_error_msg(
"ERROR: Unsupported 3D FE order!: " << order);
1197 const unsigned int i,
1198 const unsigned int j,
1201 libmesh_assert(elem);
1212 const unsigned int i,
1213 const unsigned int j,
1216 #if LIBMESH_DIM == 3 1218 libmesh_assert_less (j, 6);
1237 static bool warning_given_HEX20 =
false;
1239 if (!warning_given_HEX20)
1240 libMesh::err <<
"Second derivatives for 3D Lagrangian HEX20" 1241 <<
" elements are not yet implemented!" 1243 warning_given_HEX20 =
true;
1245 libmesh_fallthrough();
1250 libmesh_assert_less (i, 27);
1253 const Real xi = p(0);
1254 const Real eta = p(1);
1255 const Real zeta = p(2);
1261 static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1262 static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1263 static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1304 libmesh_error_msg(
"Invalid j = " << j);
1317 static const Real dzetadxi[4][3] =
1327 static const unsigned short int independent_var_indices[6][2] =
1341 static const unsigned short int zeta_indices[10][2] =
1356 const unsigned int my_j = independent_var_indices[j][0];
1357 const unsigned int my_k = independent_var_indices[j][1];
1361 return 4.*dzetadxi[i][my_j]*dzetadxi[i][my_k];
1366 const unsigned short int my_m = zeta_indices[i][0];
1367 const unsigned short int my_n = zeta_indices[i][1];
1369 return 4.*(dzetadxi[my_n][my_j]*dzetadxi[my_m][my_k] +
1370 dzetadxi[my_m][my_j]*dzetadxi[my_n][my_k] );
1373 libmesh_error_msg(
"Invalid shape function index " << i);
1380 libmesh_assert_less (i, 18);
1385 Point p2d(p(0),p(1));
1389 static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1390 static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1425 libmesh_error_msg(
"Invalid shape function derivative j = " << j);
1432 libmesh_error_msg(
"ERROR: Unsupported 3D element type!: " << type);
1439 libmesh_error_msg(
"ERROR: Unsupported 3D FE order!: " << order);
1450 const unsigned int i,
1451 const unsigned int j,
1454 libmesh_assert(elem);
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
The base class for all geometric element types.
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
Template class which generates the different FE families and orders.
OStreamProxy err(std::cerr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
A geometric point in (x,y,z) space.
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)