18 #include "libmesh/hcurl_fe_transformation.h" 
   19 #include "libmesh/fe_interface.h" 
   20 #include "libmesh/int_range.h" 
   25 template<
typename OutputShape>
 
   33 template<
typename OutputShape>
 
   41 template<
typename OutputShape>
 
   45 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 
   52 template<
typename OutputShape>
 
   54                                                  const Elem * 
const elem,
 
   55                                                  const std::vector<Point> & qp,
 
   57                                                  std::vector<std::vector<OutputShape>> & phi)
 const 
   63       libmesh_error_msg(
"These element transformations only make sense in 2D and 3D.");
 
   90               FEInterface::shape<OutputShape>(2, fe.
get_fe_type(), elem, i, qp[p], phi_ref);
 
   92               phi[i][p](0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1);
 
   94               phi[i][p](1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1);
 
  132               FEInterface::shape<OutputShape>(3, fe.
get_fe_type(), elem, i, qp[p], phi_ref);
 
  134               phi[i][p].slice(0) = dxidx_map[p]*phi_ref.slice(0) + detadx_map[p]*phi_ref.slice(1)
 
  135                 + dzetadx_map[p]*phi_ref.slice(2);
 
  137               phi[i][p].slice(1) = dxidy_map[p]*phi_ref.slice(0) + detady_map[p]*phi_ref.slice(1)
 
  138                 + dzetady_map[p]*phi_ref.slice(2);
 
  140               phi[i][p].slice(2) = dxidz_map[p]*phi_ref.slice(0) + detadz_map[p]*phi_ref.slice(1)
 
  141                 + dzetadz_map[p]*phi_ref.slice(2);
 
  147       libmesh_error_msg(
"Invalid dim = " << 
dim);
 
  151 template<
typename OutputShape>
 
  154                                                   const std::vector<Point> &,
 
  156                                                   std::vector<std::vector<OutputShape>> & curl_phi)
 const 
  162       libmesh_error_msg(
"These element transformations only make sense in 2D and 3D.");
 
  166         const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
 
  167         const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
 
  176               curl_phi[i][p].slice(0) = curl_phi[i][p].slice(1) = 0.0;
 
  177               curl_phi[i][p].slice(2) = ( dphi_dxi[i][p].slice(1) - dphi_deta[i][p].slice(0) )/J[p];
 
  185         const std::vector<std::vector<OutputShape>> & dphi_dxi = fe.
get_dphidxi();
 
  186         const std::vector<std::vector<OutputShape>> & dphi_deta = fe.
get_dphideta();
 
  187         const std::vector<std::vector<OutputShape>> & dphi_dzeta = fe.
get_dphidzeta();
 
  198               Real dx_dxi   = dxyz_dxi[p](0);
 
  199               Real dx_deta  = dxyz_deta[p](0);
 
  200               Real dx_dzeta = dxyz_dzeta[p](0);
 
  202               Real dy_dxi   = dxyz_dxi[p](1);
 
  203               Real dy_deta  = dxyz_deta[p](1);
 
  204               Real dy_dzeta = dxyz_dzeta[p](1);
 
  206               Real dz_dxi   = dxyz_dxi[p](2);
 
  207               Real dz_deta  = dxyz_deta[p](2);
 
  208               Real dz_dzeta = dxyz_dzeta[p](2);
 
  210               const Real inv_jac = 1.0/J[p];
 
  222               curl_phi[i][p].slice(0) = inv_jac*( dx_dxi*( dphi_deta[i][p].slice(2)  -
 
  223                                                            dphi_dzeta[i][p].slice(1)   ) +
 
  224                                                   dx_deta*( dphi_dzeta[i][p].slice(0) -
 
  225                                                             dphi_dxi[i][p].slice(2)     ) +
 
  226                                                   dx_dzeta*( dphi_dxi[i][p].slice(1) -
 
  227                                                              dphi_deta[i][p].slice(0)    ) );
 
  229               curl_phi[i][p].slice(1) = inv_jac*( dy_dxi*( dphi_deta[i][p].slice(2) -
 
  230                                                            dphi_dzeta[i][p].slice(1)  ) +
 
  231                                                   dy_deta*( dphi_dzeta[i][p].slice(0)-
 
  232                                                             dphi_dxi[i][p].slice(2)    ) +
 
  233                                                   dy_dzeta*( dphi_dxi[i][p].slice(1) -
 
  234                                                              dphi_deta[i][p].slice(0)   ) );
 
  236               curl_phi[i][p].slice(2) = inv_jac*( dz_dxi*( dphi_deta[i][p].slice(2) -
 
  237                                                            dphi_dzeta[i][p].slice(1)   ) +
 
  238                                                   dz_deta*( dphi_dzeta[i][p].slice(0) -
 
  239                                                             dphi_dxi[i][p].slice(2)     ) +
 
  240                                                   dz_dzeta*( dphi_dxi[i][p].slice(1) -
 
  241                                                              dphi_deta[i][p].slice(0)    ) );
 
  248       libmesh_error_msg(
"Invalid dim = " << 
dim);
 
  257   libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
 
  263   libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
 
  269   libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
 
  275                                           const std::vector<Point> &,
 
  277                                           std::vector<std::vector<Real>> &)
 const 
  279   libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");
 
  285                                            const std::vector<Point> &,
 
  287                                            std::vector<std::vector<Real>> &)
 const 
  289   libmesh_error_msg(
"HCurl transformations only make sense for vector-valued elements.");