23 #include "libmesh/libmesh_config.h" 
   24 #ifdef LIBMESH_ENABLE_HIGHER_ORDER_SHAPES 
   26 #include "libmesh/fe.h" 
   27 #include "libmesh/elem.h" 
   41   libmesh_error_msg(
"Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
 
   52                             const bool add_p_level)
 
   60   const Order totalorder =
 
   61     static_cast<Order>(order + add_p_level * elem->
p_level());
 
   75               libmesh_assert_less (i, 4);
 
   78               const Real zeta1 = p(0);
 
   79               const Real zeta2 = p(1);
 
   80               const Real zeta3 = p(2);
 
   81               const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
 
   91                   libmesh_error_msg(
"Invalid shape function index i = " << i);
 
  100               libmesh_assert_less (i, 8);
 
  103               const Real xi   = p(0);
 
  104               const Real eta  = p(1);
 
  105               const Real zeta = p(2);
 
  111               static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
 
  112               static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
 
  113               static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
 
  122             libmesh_error_msg(
"Invalid element type = " << type);
 
  137               libmesh_assert_less (i, 10);
 
  140               const Real zeta1 = p(0);
 
  141               const Real zeta2 = p(1);
 
  142               const Real zeta3 = p(2);
 
  143               const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
 
  147                 case  0:  
return zeta0*zeta0;
 
  148                 case  1:  
return zeta1*zeta1;
 
  149                 case  2:  
return zeta2*zeta2;
 
  150                 case  3:  
return zeta3*zeta3;
 
  151                 case  4:  
return 2.*zeta0*zeta1;
 
  152                 case  5:  
return 2.*zeta1*zeta2;
 
  153                 case  6:  
return 2.*zeta0*zeta2;
 
  154                 case  7:  
return 2.*zeta3*zeta0;
 
  155                 case  8:  
return 2.*zeta1*zeta3;
 
  156                 case  9:  
return 2.*zeta2*zeta3;
 
  159                   libmesh_error_msg(
"Invalid shape function index i = " << i);
 
  166               libmesh_assert_less (i, 20);
 
  169               const Real xi   = p(0);
 
  170               const Real eta  = p(1);
 
  171               const Real zeta = p(2);
 
  177               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};
 
  178               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};
 
  179               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};
 
  185               static const Real scal20[] =     {-0.25, -0.25, -0.25, -0.25, 0,     0,     0,     0,     0.5,   0.5,   0.5,   0.5,   0,     0,     0,     0,     0,     0,     0,     0};
 
  186               static const Real scal21[] =     {-0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0,     0};
 
  187               static const Real scal22[] =     {0,     -0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0};
 
  188               static const Real scal23[] =     {0,     0,     -0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0};
 
  189               static const Real scal24[] =     {-0.25, 0,     0,     -0.25, -0.25, 0,     0,     -0.25, 0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0,     0,     0.5};
 
  190               static const Real scal25[] =     {0,     0,     0,     0,     -0.25, -0.25, -0.25, -0.25, 0,     0,     0,     0,     0,     0,     0,     0,     0.5,   0.5,   0.5,   0.5};
 
  191               static const Real scal26[] =     {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25};
 
  229               libmesh_assert_less (i, 27);
 
  232               const Real xi   = p(0);
 
  233               const Real eta  = p(1);
 
  234               const Real zeta = p(2);
 
  240               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};
 
  241               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};
 
  242               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};
 
  251             libmesh_error_msg(
"Invalid element type = " << type);
 
  332               libmesh_assert_less (i, 64);
 
  335               const Real xi    = p(0);
 
  336               const Real eta   = p(1);
 
  337               const Real zeta  = p(2);
 
  338               Real xi_mapped   = p(0);
 
  339               Real eta_mapped  = p(1);
 
  340               Real zeta_mapped = p(2);
 
  347               static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3};
 
  348               static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3};
 
  349               static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
 
  356                 if ((i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
 
  362                 else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
 
  368                 else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
 
  374                 else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
 
  380                 else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
 
  386                 else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
 
  392                 else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
 
  398                 else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
 
  404                 else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
 
  410                 else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
 
  416                 else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
 
  422                 else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
 
  433                 if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
 
  435                     const Point min_point = std::min(elem->
point(1),
 
  436                                                      std::min(elem->
point(2),
 
  437                                                               std::min(elem->
point(0),
 
  439                     if (elem->
point(0) == min_point)
 
  453                     else if (elem->
point(3) == min_point)
 
  467                     else if (elem->
point(2) == min_point)
 
  481                     else if (elem->
point(1) == min_point)
 
  500                 else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
 
  502                     const Point min_point = std::min(elem->
point(0),
 
  503                                                      std::min(elem->
point(1),
 
  504                                                               std::min(elem->
point(5),
 
  506                     if (elem->
point(0) == min_point)
 
  520                     else if (elem->
point(1) == min_point)
 
  534                     else if (elem->
point(5) == min_point)
 
  548                     else if (elem->
point(4) == min_point)
 
  567                 else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
 
  569                     const Point min_point = std::min(elem->
point(1),
 
  570                                                      std::min(elem->
point(2),
 
  571                                                               std::min(elem->
point(6),
 
  573                     if (elem->
point(1) == min_point)
 
  587                     else if (elem->
point(2) == min_point)
 
  601                     else if (elem->
point(6) == min_point)
 
  615                     else if (elem->
point(5) == min_point)
 
  634                 else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
 
  636                     const Point min_point = std::min(elem->
point(2),
 
  637                                                      std::min(elem->
point(3),
 
  638                                                               std::min(elem->
point(7),
 
  640                     if (elem->
point(3) == min_point)
 
  654                     else if (elem->
point(7) == min_point)
 
  668                     else if (elem->
point(6) == min_point)
 
  682                     else if (elem->
point(2) == min_point)
 
  701                 else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
 
  703                     const Point min_point = std::min(elem->
point(3),
 
  704                                                      std::min(elem->
point(0),
 
  705                                                               std::min(elem->
point(4),
 
  707                     if (elem->
point(0) == min_point)
 
  721                     else if (elem->
point(4) == min_point)
 
  735                     else if (elem->
point(7) == min_point)
 
  749                     else if (elem->
point(3) == min_point)
 
  768                 else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
 
  770                     const Point min_point = std::min(elem->
point(4),
 
  771                                                      std::min(elem->
point(5),
 
  772                                                               std::min(elem->
point(6),
 
  774                     if (elem->
point(4) == min_point)
 
  788                     else if (elem->
point(5) == min_point)
 
  802                     else if (elem->
point(6) == min_point)
 
  816                     else if (elem->
point(7) == min_point)
 
  841             libmesh_error_msg(
"Invalid element type = " << type);
 
  856               libmesh_assert_less (i, 125);
 
  859               const Real xi    = p(0);
 
  860               const Real eta   = p(1);
 
  861               const Real zeta  = p(2);
 
  862               Real xi_mapped   = p(0);
 
  863               Real eta_mapped  = p(1);
 
  864               Real zeta_mapped = p(2);
 
  871               static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4};
 
  872               static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
 
  873               static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4};
 
  880                 if ((i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
 
  886                 else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
 
  892                 else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
 
  898                 else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
 
  904                 else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
 
  910                 else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
 
  916                 else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
 
  922                 else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
 
  928                 else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
 
  934                 else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
 
  940                 else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
 
  946                 else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
 
  957                 if ((i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
 
  959                     const Point min_point = std::min(elem->
point(1),
 
  960                                                      std::min(elem->
point(2),
 
  961                                                               std::min(elem->
point(0),
 
  963                     if (elem->
point(0) == min_point)
 
  977                     else if (elem->
point(3) == min_point)
 
  991                     else if (elem->
point(2) == min_point)
 
 1005                     else if (elem->
point(1) == min_point)
 
 1024                 else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
 
 1026                     const Point min_point = std::min(elem->
point(0),
 
 1027                                                      std::min(elem->
point(1),
 
 1028                                                               std::min(elem->
point(5),
 
 1030                     if (elem->
point(0) == min_point)
 
 1044                     else if (elem->
point(1) == min_point)
 
 1058                     else if (elem->
point(5) == min_point)
 
 1063                           zeta_mapped = -zeta;
 
 1072                     else if (elem->
point(4) == min_point)
 
 1084                             zeta_mapped = -zeta;
 
 1091                 else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
 
 1093                     const Point min_point = std::min(elem->
point(1),
 
 1094                                                      std::min(elem->
point(2),
 
 1095                                                               std::min(elem->
point(6),
 
 1097                     if (elem->
point(1) == min_point)
 
 1111                     else if (elem->
point(2) == min_point)
 
 1125                     else if (elem->
point(6) == min_point)
 
 1130                           zeta_mapped = -zeta;
 
 1139                     else if (elem->
point(5) == min_point)
 
 1151                             zeta_mapped = -zeta;
 
 1158                 else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
 
 1160                     const Point min_point = std::min(elem->
point(2),
 
 1161                                                      std::min(elem->
point(3),
 
 1162                                                               std::min(elem->
point(7),
 
 1164                     if (elem->
point(3) == min_point)
 
 1178                     else if (elem->
point(7) == min_point)
 
 1189                           zeta_mapped = -zeta;
 
 1192                     else if (elem->
point(6) == min_point)
 
 1197                           zeta_mapped = -zeta;
 
 1206                     else if (elem->
point(2) == min_point)
 
 1225                 else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
 
 1227                     const Point min_point = std::min(elem->
point(3),
 
 1228                                                      std::min(elem->
point(0),
 
 1229                                                               std::min(elem->
point(4),
 
 1231                     if (elem->
point(0) == min_point)
 
 1245                     else if (elem->
point(4) == min_point)
 
 1256                           zeta_mapped = -zeta;
 
 1259                     else if (elem->
point(7) == min_point)
 
 1264                           zeta_mapped = -zeta;
 
 1273                     else if (elem->
point(3) == min_point)
 
 1292                 else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
 
 1294                     const Point min_point = std::min(elem->
point(4),
 
 1295                                                      std::min(elem->
point(5),
 
 1296                                                               std::min(elem->
point(6),
 
 1298                     if (elem->
point(4) == min_point)
 
 1312                     else if (elem->
point(5) == min_point)
 
 1326                     else if (elem->
point(6) == min_point)
 
 1340                     else if (elem->
point(7) == min_point)
 
 1368             libmesh_error_msg(
"Invalid element type = " << type);
 
 1374       libmesh_error_msg(
"Invalid totalorder = " << totalorder);
 
 1376 #else // LIBMESH_DIM != 3 
 1378   libmesh_not_implemented();
 
 1392   libmesh_error_msg(
"Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
 
 1401                                   const unsigned int i,
 
 1402                                   const unsigned int j,
 
 1404                                   const bool add_p_level)
 
 1407 #if LIBMESH_DIM == 3 
 1411   const Order totalorder =
 
 1412     static_cast<Order>(order + add_p_level * elem->
p_level());
 
 1414   libmesh_assert_less (j, 3);
 
 1429               const Real eps = 1.e-6;
 
 1431               libmesh_assert_less (i, 4);
 
 1432               libmesh_assert_less (j, 3);
 
 1440                     const Point pp(p(0)+eps, p(1), p(2));
 
 1441                     const Point pm(p(0)-eps, p(1), p(2));
 
 1450                     const Point pp(p(0), p(1)+eps, p(2));
 
 1451                     const Point pm(p(0), p(1)-eps, p(2));
 
 1459                     const Point pp(p(0), p(1), p(2)+eps);
 
 1460                     const Point pm(p(0), p(1), p(2)-eps);
 
 1466                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 1478               libmesh_assert_less (i, 8);
 
 1481               const Real xi   = p(0);
 
 1482               const Real eta  = p(1);
 
 1483               const Real zeta = p(2);
 
 1489               static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
 
 1490               static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
 
 1491               static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
 
 1514                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 1519             libmesh_error_msg(
"Invalid element type = " << type);
 
 1535               const Real eps = 1.e-6;
 
 1537               libmesh_assert_less (i, 10);
 
 1538               libmesh_assert_less (j, 3);
 
 1546                     const Point pp(p(0)+eps, p(1), p(2));
 
 1547                     const Point pm(p(0)-eps, p(1), p(2));
 
 1556                     const Point pp(p(0), p(1)+eps, p(2));
 
 1557                     const Point pm(p(0), p(1)-eps, p(2));
 
 1565                     const Point pp(p(0), p(1), p(2)+eps);
 
 1566                     const Point pm(p(0), p(1), p(2)-eps);
 
 1572                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 1579               libmesh_assert_less (i, 20);
 
 1582               const Real xi   = p(0);
 
 1583               const Real eta  = p(1);
 
 1584               const Real zeta = p(2);
 
 1590               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};
 
 1591               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};
 
 1592               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};
 
 1593               static const Real scal20[] =     {-0.25, -0.25, -0.25, -0.25, 0,     0,     0,     0,     0.5,   0.5,   0.5,   0.5,   0,     0,     0,     0,     0,     0,     0,     0};
 
 1594               static const Real scal21[] =     {-0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0,     0};
 
 1595               static const Real scal22[] =     {0,     -0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0};
 
 1596               static const Real scal23[] =     {0,     0,     -0.25, -0.25, 0,     0,     -0.25, -0.25, 0,     0,     0.5,   0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0};
 
 1597               static const Real scal24[] =     {-0.25, 0,     0,     -0.25, -0.25, 0,     0,     -0.25, 0,     0,     0,     0.5,   0.5,   0,     0,     0.5,   0,     0,     0,     0.5};
 
 1598               static const Real scal25[] =     {0,     0,     0,     0,     -0.25, -0.25, -0.25, -0.25, 0,     0,     0,     0,     0,     0,     0,     0,     0.5,   0.5,   0.5,   0.5};
 
 1599               static const Real scal26[] =     {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25,  0.25};
 
 1706                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 1713               libmesh_assert_less (i, 27);
 
 1716               const Real xi   = p(0);
 
 1717               const Real eta  = p(1);
 
 1718               const Real zeta = p(2);
 
 1724               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};
 
 1725               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};
 
 1726               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};
 
 1749                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 1755             libmesh_error_msg(
"Invalid element type = " << type);
 
 1820               const Real eps = 1.e-6;
 
 1822               libmesh_assert_less (i, 64);
 
 1823               libmesh_assert_less (j, 3);
 
 1830                     const Point pp(p(0)+eps, p(1), p(2));
 
 1831                     const Point pm(p(0)-eps, p(1), p(2));
 
 1840                     const Point pp(p(0), p(1)+eps, p(2));
 
 1841                     const Point pm(p(0), p(1)-eps, p(2));
 
 1849                     const Point pp(p(0), p(1), p(2)+eps);
 
 1850                     const Point pm(p(0), p(1), p(2)-eps);
 
 1856                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 2382             libmesh_error_msg(
"Invalid element type = " << type);
 
 2395               const Real eps = 1.e-6;
 
 2397               libmesh_assert_less (i, 125);
 
 2398               libmesh_assert_less (j, 3);
 
 2405                     const Point pp(p(0)+eps, p(1), p(2));
 
 2406                     const Point pm(p(0)-eps, p(1), p(2));
 
 2415                     const Point pp(p(0), p(1)+eps, p(2));
 
 2416                     const Point pm(p(0), p(1)-eps, p(2));
 
 2424                     const Point pp(p(0), p(1), p(2)+eps);
 
 2425                     const Point pm(p(0), p(1), p(2)-eps);
 
 2431                   libmesh_error_msg(
"Invalid derivative index j = " << j);
 
 2956             libmesh_error_msg(
"Invalid element type = " << type);
 
 2962       libmesh_error_msg(
"Invalid totalorder = " << totalorder);
 
 2965 #else // LIBMESH_DIM != 3 
 2967   libmesh_not_implemented();
 
 2972 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 
 2981   static bool warning_given = 
false;
 
 2984     libMesh::err << 
"Second derivatives for Bernstein elements " 
 2985                  << 
"are not yet implemented!" 
 2988   warning_given = 
true;
 
 3002   static bool warning_given = 
false;
 
 3005     libMesh::err << 
"Second derivatives for Bernstein elements " 
 3006                  << 
"are not yet implemented!" 
 3009   warning_given = 
true;
 
 3019 #endif //LIBMESH_ENABLE_HIGHER_ORDER_SHAPES