49 #ifndef __INTREPID2_BASIS_DEF_HPP__ 
   50 #define __INTREPID2_BASIS_DEF_HPP__ 
   66   KOKKOS_INLINE_FUNCTION
 
   67   ordinal_type getFieldRank(
const EFunctionSpace spaceType) {
 
   68     ordinal_type fieldRank = -1;
 
   72     case FUNCTION_SPACE_HGRAD:
 
   73     case FUNCTION_SPACE_HVOL:
 
   77     case FUNCTION_SPACE_HCURL:
 
   78     case FUNCTION_SPACE_HDIV:
 
   79     case FUNCTION_SPACE_VECTOR_HGRAD:
 
   83     case FUNCTION_SPACE_TENSOR_HGRAD:
 
   88       INTREPID2_TEST_FOR_ABORT( !isValidFunctionSpace(spaceType),
 
   89                                 ">>> ERROR (Intrepid2::getFieldRank): Invalid function space type");
 
   95   KOKKOS_INLINE_FUNCTION
 
   96   ordinal_type getOperatorRank(
const EFunctionSpace spaceType,
 
   97                                const EOperator      operatorType,
 
   98                                const ordinal_type   spaceDim) {
 
  100     const auto fieldRank = Intrepid2::getFieldRank(spaceType);
 
  101 #ifdef HAVE_INTREPID2_DEBUG 
  103     INTREPID2_TEST_FOR_ABORT( !(0 <= fieldRank && fieldRank <= 2),
 
  104                               ">>> ERROR (Intrepid2::getOperatorRank): Invalid field rank");
 
  105     INTREPID2_TEST_FOR_ABORT( !(1 <= spaceDim && spaceDim  <= 3),
 
  106                               ">>> ERROR (Intrepid2::getOperatorRank): Invalid space dimension");
 
  108     ordinal_type operatorRank = -999;
 
  112       if (fieldRank == 0) {
 
  114         if (operatorType == OPERATOR_VALUE) {
 
  123         INTREPID2_TEST_FOR_ABORT( fieldRank > 0,
 
  124                                   ">>> ERROR (getOperatorRank): Only scalar fields are allowed in 1D");
 
  130       switch (operatorType) {
 
  153           operatorRank = spaceDim - 3;
 
  158             operatorRank = 3 - spaceDim;
 
  163             INTREPID2_TEST_FOR_ABORT( ( (spaceDim == 3) && (fieldRank == 0) ),
 
  164                                       ">>> ERROR (Intrepid2::getOperatorRank): CURL cannot be applied to scalar fields in 3D");
 
  178           INTREPID2_TEST_FOR_ABORT( ( (spaceDim > 1) && (fieldRank == 0) ),
 
  179                                     ">>> ERROR (Intrepid2::getOperatorRank): DIV cannot be applied to scalar fields in 2D and 3D");
 
  184         INTREPID2_TEST_FOR_ABORT( !( isValidOperator(operatorType) ),
 
  185                                   ">>> ERROR (Intrepid2::getOperatorRank): Invalid operator type");
 
  193   KOKKOS_INLINE_FUNCTION
 
  194   ordinal_type getOperatorOrder(
const EOperator operatorType) {
 
  195     ordinal_type opOrder = -1;
 
  197     switch (operatorType) {
 
  219       opOrder = (ordinal_type)operatorType - (ordinal_type)OPERATOR_D1 + 1;
 
  223       INTREPID2_TEST_FOR_ABORT( !( Intrepid2::isValidOperator(operatorType) ),
 
  224                                 ">>> ERROR (Intrepid2::getOperatorOrder): Invalid operator type");
 
  229   template<EOperator operatorType>
 
  230   KOKKOS_INLINE_FUNCTION
 
  231   constexpr ordinal_type getOperatorOrder() {
 
  232     return (operatorType == OPERATOR_VALUE) ? 0 :
 
  233            ((operatorType == OPERATOR_GRAD) || (operatorType == OPERATOR_CURL) || (operatorType == OPERATOR_DIV) || (operatorType == OPERATOR_D1)) ? 1 :
 
  234            (ordinal_type)operatorType - (ordinal_type)OPERATOR_D1 + 1;
 
  238   template<ordinal_type spaceDim>
 
  239   KOKKOS_INLINE_FUNCTION
 
  240   ordinal_type getDkEnumeration(
const ordinal_type ,
 
  241                                 const ordinal_type yMult,
 
  242                                 const ordinal_type zMult) {
 
  247 #ifndef __NVCC__ //prevent nvcc warning 
  253 #ifndef __NVCC__ //prevent nvcc warning 
  258         return zMult + (yMult+zMult)*(yMult+zMult+1)/2;
 
  259 #ifndef __NVCC__ //prevent nvcc warning 
  264         INTREPID2_TEST_FOR_ABORT( !( (0 < spaceDim ) && (spaceDim < 4) ),
 
  265               ">>> ERROR (Intrepid2::getDkEnumeration): Invalid space dimension");
 
  271   template<ordinal_type spaceDim>
 
  272   KOKKOS_INLINE_FUNCTION
 
  273   ordinal_type getPnEnumeration(
const ordinal_type p,
 
  274                                 const ordinal_type q ,
 
  275                                 const ordinal_type r ) {
 
  276     return (spaceDim==1) ? p :
 
  277            (spaceDim==2) ? (p+q)*(p+q+1)/2+q :
 
  278                            (p+q+r)*(p+q+r+1)*(p+q+r+2)/6+(q+r)*(q+r+1)/2+r;
 
  282   template<
typename value_type>
 
  283   KOKKOS_INLINE_FUNCTION
 
  284   void getJacobyRecurrenceCoeffs (
 
  288       const ordinal_type alpha,
 
  289       const ordinal_type beta ,
 
  290       const ordinal_type n) {
 
  291     an = ( (2.0 * n + 1.0 + alpha + beta) * ( 2.0 * n + 2.0 + alpha + beta ) /
 
  292         value_type(2.0 * ( n + 1 ) * ( n + 1 + alpha + beta ) ) );
 
  293     bn = ( (alpha*alpha-beta*beta)*(2.0*n+1.0+alpha+beta) /
 
  294         value_type(2.0*(n+1.0)*(2.0*n+alpha+beta)*(n+1.0+alpha+beta) ) );
 
  295     cn = ( (n+alpha)*(n+beta)*(2.0*n+2.0+alpha+beta) /
 
  296         value_type( (n+1.0)*(n+1.0+alpha+beta)*(2.0*n+alpha+beta) ) );
 
  409   KOKKOS_INLINE_FUNCTION
 
  410   ordinal_type getDkCardinality(
const EOperator    operatorType,
 
  411                                 const ordinal_type spaceDim) {
 
  413 #ifdef HAVE_INTREPID2_DEBUG 
  414     INTREPID2_TEST_FOR_ABORT( !( (0 < spaceDim ) && (spaceDim < 4) ),
 
  415                                     ">>> ERROR (Intrepid2::getDkcardinality): Invalid space dimension");
 
  416     switch (operatorType) {
 
  430           INTREPID2_TEST_FOR_ABORT( 
true, 
">>> ERROR (Intrepid2::getDkCardinality): Cannot be used for this operator ");
 
  435     ordinal_type n = Intrepid2::getOperatorOrder(operatorType);
 
  436     return (spaceDim==1) ? 1 :
 
  437            (spaceDim==2) ? n+1 :
 
  438                           (n + 1) * (n + 2) / 2;
 
  441   template<EOperator operatorType, ordinal_type spaceDim>
 
  442   KOKKOS_INLINE_FUNCTION
 
  443   constexpr ordinal_type getDkCardinality() {
 
  444     return getPnCardinality<spaceDim-1,Intrepid2::getOperatorOrder<operatorType>()>();
 
  447   template<ordinal_type spaceDim>
 
  448   KOKKOS_INLINE_FUNCTION
 
  449   ordinal_type getPnCardinality (ordinal_type n) {
 
  451 #ifdef HAVE_INTREPID2_DEBUG 
  452     INTREPID2_TEST_FOR_ABORT( !( (0 <= spaceDim ) && (spaceDim < 4) ),
 
  453                                         ">>> ERROR (Intrepid2::getPnCardinality): Invalid space dimension");
 
  456     return (spaceDim==0) ? 1 :
 
  457            (spaceDim==1) ? n+1 :
 
  458            (spaceDim==2) ? (n + 1) * (n + 2) / 2 :
 
  459            (n + 1) * (n + 2) * (n + 3) / 6;
 
  463   template<ordinal_type spaceDim, ordinal_type n>
 
  464   KOKKOS_INLINE_FUNCTION
 
  465   constexpr ordinal_type getPnCardinality () {
 
  467     return (spaceDim==0) ? 1 :
 
  468            (spaceDim==1) ? n+1 :
 
  469            (spaceDim==2) ? (n + 1) * (n + 2) / 2 :
 
  470            (n + 1) * (n + 2) * (n + 3) / 6;
 
  482   template<
typename outputValueViewType,
 
  483            typename inputPointViewType>
 
  484   void getValues_HGRAD_Args( 
const outputValueViewType   outputValues,
 
  485                              const inputPointViewType    inputPoints,
 
  486                              const EOperator             operatorType,
 
  487                              const shards::CellTopology  cellTopo,
 
  488                              const ordinal_type          basisCard ) {
 
  489     const auto spaceDim = cellTopo.getDimension();
 
  492     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
 
  493                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for inputPoints array");
 
  495     INTREPID2_TEST_FOR_EXCEPTION(  (inputPoints.extent(0) <= 0), std::invalid_argument,
 
  496                                    ">>> ERROR (Intrepid2::getValues_HGRAD_Args): dim 0 (number of points) > 0 required for inputPoints array");
 
  498     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.extent(1) == spaceDim), std::invalid_argument,
 
  499                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 1 (spatial dimension) of inputPoints array  does not match cell dimension");
 
  511     INTREPID2_TEST_FOR_EXCEPTION( ( (spaceDim == 2) && (operatorType == OPERATOR_DIV) ), std::invalid_argument,
 
  512                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) DIV is invalid operator for rank-0 (scalar) fields in 2D.");
 
  514     INTREPID2_TEST_FOR_EXCEPTION( ( (spaceDim == 3) && ( (operatorType == OPERATOR_DIV) ||
 
  515                                                          (operatorType == OPERATOR_CURL) ) ), std::invalid_argument,
 
  516                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) DIV and CURL are invalid operators for rank-0 (scalar) fields in 3D.");
 
  523       switch(operatorType){
 
  525         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
 
  526                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
 
  541         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  542                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 1D when operator = GRAD, CURL, DIV, or Dk.");
 
  544         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == 1 ),
 
  545                                       std::invalid_argument,
 
  546                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal 1 when operator = GRAD, CURL, DIV, or Dk.");
 
  549         INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HGRAD_Args) Invalid operator");
 
  552     else if(spaceDim > 1) {
 
  553       switch(operatorType){
 
  555         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
 
  556                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
 
  561         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  562                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
 
  564         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == spaceDim ),
 
  565                                       std::invalid_argument,
 
  566                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal cell dimension when operator = GRAD, CURL (in 2D), or D1.");
 
  577         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  578                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
 
  580         INTREPID2_TEST_FOR_EXCEPTION( !(static_cast<ordinal_type>(outputValues.extent(2)) == getDkCardinality(operatorType, spaceDim)),
 
  581                                       std::invalid_argument,
 
  582                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal cardinality of the Dk multiset.");
 
  585         INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HGRAD_Args) Invalid operator");
 
  591     INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(1) == inputPoints.extent(0) ),
 
  592                                   std::invalid_argument,
 
  593                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
 
  595     INTREPID2_TEST_FOR_EXCEPTION( !(static_cast<ordinal_type>(outputValues.extent(0)) == basisCard ),
 
  596                                   std::invalid_argument,
 
  597                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
 
  601   template<
typename outputValueViewType,
 
  602            typename inputPointViewType>
 
  603   void getValues_HCURL_Args( 
const outputValueViewType   outputValues,
 
  604                              const inputPointViewType    inputPoints,
 
  605                              const EOperator             operatorType,
 
  606                              const shards::CellTopology  cellTopo,
 
  607                              const ordinal_type          basisCard ) {
 
  609     const auto spaceDim = cellTopo.getDimension();
 
  613     INTREPID2_TEST_FOR_EXCEPTION( !( (spaceDim == 2) || (spaceDim == 3) ), std::invalid_argument,
 
  614                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) cell dimension = 2 or 3 required for HCURL basis");
 
  618     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
 
  619                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) rank = 2 required for inputPoints array");
 
  620     INTREPID2_TEST_FOR_EXCEPTION(  (inputPoints.extent(0) <= 0), std::invalid_argument,
 
  621                                    ">>> ERROR (Intrepid2::getValues_HCURL_Args): dim 0 (number of points) > 0 required for inputPoints array");
 
  623     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.extent(1) == spaceDim), std::invalid_argument,
 
  624                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) dim 1 (spatial dimension) of inputPoints array  does not match cell dimension");
 
  634     INTREPID2_TEST_FOR_EXCEPTION( !( (operatorType == OPERATOR_VALUE) || (operatorType == OPERATOR_CURL) ), std::invalid_argument,
 
  635                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) operator = VALUE or CURL required for HCURL fields.");
 
  639     switch(operatorType) {
 
  642       INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  643                                     ">>> ERROR: (Intrepid2::getValues_HCURL_Args) rank = 3 required for outputValues when operator is VALUE");
 
  644       INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == spaceDim ),
 
  645                                     std::invalid_argument,
 
  646                                     ">>> ERROR: (Intrepid2::getValues_HCURL_Args) dim 2 of outputValues must equal cell dimension when operator is VALUE.");
 
  653         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3 ) ,
 
  654                                       std::invalid_argument,
 
  655                                       ">>> ERROR: (Intrepid2::getValues_HCURL_Args) rank = 3 required for outputValues in 3D when operator is CURL");
 
  656         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == spaceDim),
 
  657                                       std::invalid_argument,
 
  658                                       ">>> ERROR: (Intrepid2::getValues_HCURL_Args) dim 2 of outputValues must equal cell dimension in 3D when operator is CURL.");
 
  661       else if(spaceDim == 2) {
 
  662         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2 ) ,
 
  663                                       std::invalid_argument,
 
  664                                       ">>> ERROR: (Intrepid2::getValues_HCURL_Args) rank = 2 required for outputValues in 2D when operator is CURL");
 
  669       INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HCURL_Args) Invalid operator");
 
  674     INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(1) == inputPoints.extent(0) ),
 
  675                                   std::invalid_argument,
 
  676                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
 
  678     INTREPID2_TEST_FOR_EXCEPTION( !(static_cast<ordinal_type>(outputValues.extent(0)) == basisCard ),
 
  679                                   std::invalid_argument,
 
  680                                   ">>> ERROR: (Intrepid2::getValues_HCURL_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
 
  686   template<
typename outputValueViewType,
 
  687            typename inputPointViewType>
 
  688   void getValues_HDIV_Args( 
const outputValueViewType   outputValues,
 
  689                             const inputPointViewType    inputPoints,
 
  690                             const EOperator             operatorType,
 
  691                             const shards::CellTopology  cellTopo,
 
  692                             const ordinal_type          basisCard ) {
 
  694     const auto spaceDim = cellTopo.getDimension();
 
  697     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
 
  698                                   ">>> ERROR: (Intrepid2::getValues_HDIV_Args) rank = 2 required for inputPoints array");
 
  699     INTREPID2_TEST_FOR_EXCEPTION(  (inputPoints.extent(0) <= 0), std::invalid_argument,
 
  700                                    ">>> ERROR (Intrepid2::getValues_HDIV_Args): dim 0 (number of points) > 0 required for inputPoints array");
 
  702     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.extent(1) == spaceDim), std::invalid_argument,
 
  703                                   ">>> ERROR: (Intrepid2::getValues_HDIV_Args) dim 1 (spatial dimension) of inputPoints array  does not match cell dimension");
 
  713     INTREPID2_TEST_FOR_EXCEPTION( !( (operatorType == OPERATOR_VALUE) || (operatorType == OPERATOR_DIV) ), std::invalid_argument,
 
  714                                   ">>> ERROR: (Intrepid2::getValues_HDIV_Args) operator = VALUE or DIV required for HDIV fields.");
 
  718     switch(operatorType) {
 
  720       INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  721                                     ">>> ERROR: (Intrepid2::getValues_HDIV_Args) rank = 3 required for outputValues when operator is VALUE.");
 
  723       INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == spaceDim ),
 
  724                                     std::invalid_argument,
 
  725                                     ">>> ERROR: (Intrepid2::getValues_HDIV_Args) dim 2 of outputValues must equal cell dimension for operator VALUE.");
 
  728       INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
 
  729                                     ">>> ERROR: (Intrepid2::getValues_HDIV_Args) rank = 2 required for outputValues when operator is DIV.");
 
  733       INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HDIV_Args) Invalid operator");
 
  738     INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(1) == inputPoints.extent(0) ),
 
  739                                   std::invalid_argument,
 
  740                                   ">>> ERROR: (Intrepid2::getValues_HDIV_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
 
  742     INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(0) == 
static_cast<size_type
>(basisCard) ),
 
  743                                   std::invalid_argument,
 
  744                                   ">>> ERROR: (Intrepid2::getValues_HDIV_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");
 
  747   template<
typename outputValueViewType,
 
  748            typename inputPointViewType>
 
  749   void getValues_HVOL_Args( 
const outputValueViewType   outputValues,
 
  750                              const inputPointViewType    inputPoints,
 
  751                              const EOperator             operatorType,
 
  752                              const shards::CellTopology  cellTopo,
 
  753                              const ordinal_type          basisCard ) {
 
  754     const auto spaceDim = cellTopo.getDimension();
 
  757     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.rank() == 2), std::invalid_argument,
 
  758                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for inputPoints array");
 
  760     INTREPID2_TEST_FOR_EXCEPTION(  (inputPoints.extent(0) <= 0), std::invalid_argument,
 
  761                                    ">>> ERROR (Intrepid2::getValues_HGRAD_Args): dim 0 (number of points) > 0 required for inputPoints array");
 
  763     INTREPID2_TEST_FOR_EXCEPTION( !(inputPoints.extent(1) == spaceDim), std::invalid_argument,
 
  764                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 1 (spatial dimension) of inputPoints array  does not match cell dimension");
 
  776     INTREPID2_TEST_FOR_EXCEPTION( ( (spaceDim == 2) && (operatorType == OPERATOR_DIV) ), std::invalid_argument,
 
  777                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) DIV is invalid operator for rank-0 (scalar) fields in 2D.");
 
  779     INTREPID2_TEST_FOR_EXCEPTION( ( (spaceDim == 3) && ( (operatorType == OPERATOR_DIV) ||
 
  780                                                          (operatorType == OPERATOR_CURL) ) ), std::invalid_argument,
 
  781                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) DIV and CURL are invalid operators for rank-0 (scalar) fields in 3D.");
 
  788       switch(operatorType){
 
  790         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
 
  791                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
 
  806         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  807                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 1D when operator = GRAD, CURL, DIV, or Dk.");
 
  809         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == 1 ),
 
  810                                       std::invalid_argument,
 
  811                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal 1 when operator = GRAD, CURL, DIV, or Dk.");
 
  814         INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HGRAD_Args) Invalid operator");
 
  817     else if(spaceDim > 1) {
 
  818       switch(operatorType){
 
  820         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 2), std::invalid_argument,
 
  821                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 2 required for outputValues when operator = VALUE.");
 
  826         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  827                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
 
  829         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(2) == spaceDim ),
 
  830                                       std::invalid_argument,
 
  831                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal cell dimension when operator = GRAD, CURL (in 2D), or D1.");
 
  842         INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.rank() == 3), std::invalid_argument,
 
  843                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) rank = 3 required for outputValues in 2D and 3D when operator = GRAD, CURL (in 2D), or Dk.");
 
  845         INTREPID2_TEST_FOR_EXCEPTION( !(static_cast<ordinal_type>(outputValues.extent(2)) == getDkCardinality(operatorType, spaceDim)),
 
  846                                       std::invalid_argument,
 
  847                                       ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 2 of outputValues must equal cardinality of the Dk multiset.");
 
  850         INTREPID2_TEST_FOR_EXCEPTION( (
true), std::invalid_argument, 
">>> ERROR: (Intrepid2::getValues_HGRAD_Args) Invalid operator");
 
  856     INTREPID2_TEST_FOR_EXCEPTION( !(outputValues.extent(1) == inputPoints.extent(0) ),
 
  857                                   std::invalid_argument,
 
  858                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 1 (number of points) of outputValues must equal dim 0 of inputPoints.");
 
  860     INTREPID2_TEST_FOR_EXCEPTION( !(static_cast<ordinal_type>(outputValues.extent(0)) == basisCard ),
 
  861                                   std::invalid_argument,
 
  862                                   ">>> ERROR: (Intrepid2::getValues_HGRAD_Args) dim 0 (number of basis functions) of outputValues must equal basis cardinality.");