void Basis_HCURL_HEX_In_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar & outputValues, const ArrayScalar & inputPoints, const EOperator operatorType) const { // Verify arguments #ifdef HAVE_INTREPID_DEBUG Intrepid::getValues_HCURL_Args<Scalar, ArrayScalar>(outputValues, inputPoints, operatorType, this -> getBaseCellTopology(), this -> getCardinality() ); #endif // Number of evaluation points = dim 0 of inputPoints int dim0 = inputPoints.dimension(0); // separate out points FieldContainer<Scalar> xPoints(dim0,1); FieldContainer<Scalar> yPoints(dim0,1); FieldContainer<Scalar> zPoints(dim0,1); for (int i=0;i<dim0;i++) { xPoints(i,0) = inputPoints(i,0); yPoints(i,0) = inputPoints(i,1); zPoints(i,0) = inputPoints(i,2); } switch (operatorType) { case OPERATOR_VALUE: { FieldContainer<Scalar> closedBasisValsXPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> closedBasisValsYPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> closedBasisValsZPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> openBasisValsXPts( openBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> openBasisValsYPts( openBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> openBasisValsZPts( openBasis_.getCardinality() , dim0 ); closedBasis_.getValues( closedBasisValsXPts , xPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsYPts , yPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsZPts , zPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsZPts , zPoints , OPERATOR_VALUE ); // first we get the "horizontal basis functions that are tangent to the x-varying edges int bfcur = 0; for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = openBasisValsXPts(i,l) * closedBasisValsYPts(j,l) * closedBasisValsZPts(k,l); outputValues(bfcur,l,1) = 0.0; outputValues(bfcur,l,2) = 0.0; } bfcur++; } } } // second we get the basis functions in the direction of the y-varying edges for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = 0.0; outputValues(bfcur,l,1) = closedBasisValsXPts(i,l) * openBasisValsYPts(j,l) * closedBasisValsZPts(k,l); outputValues(bfcur,l,2) = 0.0; } bfcur++; } } } // third we get the basis functions in the direction of the y-varying edges for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = 0.0; outputValues(bfcur,l,1) = 0.0; outputValues(bfcur,l,2) = closedBasisValsXPts(i,l) * closedBasisValsYPts(j,l) * openBasisValsZPts(k,l); } bfcur++; } } } } break; case OPERATOR_CURL: { FieldContainer<Scalar> closedBasisValsXPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> closedBasisValsYPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> closedBasisValsZPts( closedBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> closedBasisDerivsXPts( closedBasis_.getCardinality() , dim0 , 1 ); FieldContainer<Scalar> closedBasisDerivsYPts( closedBasis_.getCardinality() , dim0 , 1 ); FieldContainer<Scalar> closedBasisDerivsZPts( closedBasis_.getCardinality() , dim0 , 1 ); FieldContainer<Scalar> openBasisValsXPts( openBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> openBasisValsYPts( openBasis_.getCardinality() , dim0 ); FieldContainer<Scalar> openBasisValsZPts( openBasis_.getCardinality() , dim0 ); closedBasis_.getValues( closedBasisValsXPts , xPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsYPts , yPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsZPts , zPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisDerivsXPts , xPoints , OPERATOR_D1 ); closedBasis_.getValues( closedBasisDerivsYPts , yPoints , OPERATOR_D1 ); closedBasis_.getValues( closedBasisDerivsZPts , zPoints , OPERATOR_D1 ); openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsZPts , zPoints , OPERATOR_VALUE ); int bfcur = 0; // first we get the basis functions that are tangent to the x-varying edges for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = 0.0; outputValues(bfcur,l,1) = -openBasisValsXPts(i,l) * closedBasisValsYPts(j,l) * closedBasisDerivsZPts(k,l,0); outputValues(bfcur,l,2) = openBasisValsXPts(i,l) * closedBasisDerivsYPts(j,l,0) * closedBasisValsZPts(k,l); } bfcur++; } } } // second we get the basis functions in the direction of the y-varying edges for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = -closedBasisValsXPts(i,l) * openBasisValsYPts(j,l) * closedBasisDerivsZPts(k,l,0); outputValues(bfcur,l,1) = 0.0; outputValues(bfcur,l,2) = closedBasisDerivsXPts(i,l,0) * openBasisValsYPts(j,l) * closedBasisValsZPts(k,l); } bfcur++; } } } // third we get the basis functions in the direction of the y-varying edges for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = closedBasisValsXPts(i,l) * closedBasisDerivsYPts(j,l,0) * openBasisValsZPts(k,l); outputValues(bfcur,l,1) = -closedBasisDerivsXPts(i,l,0) * closedBasisValsYPts(j,l) * openBasisValsZPts(k,l); outputValues(bfcur,l,2) = 0.0; } bfcur++; } } } } break; case OPERATOR_DIV: TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument, ">>> ERROR (Basis_HCURL_HEX_In_FEM): DIV is invalid operator for HCURL Basis Functions"); break; case OPERATOR_GRAD: TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument, ">>> ERROR (Basis_HCURL_HEX_In_FEM): GRAD is invalid operator for HCURL Basis Functions"); break; case OPERATOR_D1: case OPERATOR_D2: case OPERATOR_D3: case OPERATOR_D4: case OPERATOR_D5: case OPERATOR_D6: case OPERATOR_D7: case OPERATOR_D8: case OPERATOR_D9: case OPERATOR_D10: TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) || (operatorType == OPERATOR_D2) || (operatorType == OPERATOR_D3) || (operatorType == OPERATOR_D4) || (operatorType == OPERATOR_D5) || (operatorType == OPERATOR_D6) || (operatorType == OPERATOR_D7) || (operatorType == OPERATOR_D8) || (operatorType == OPERATOR_D9) || (operatorType == OPERATOR_D10) ), std::invalid_argument, ">>> ERROR (Basis_HCURL_HEX_In_FEM): Invalid operator type"); break; default: TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) && (operatorType != OPERATOR_GRAD) && (operatorType != OPERATOR_CURL) && (operatorType != OPERATOR_CURL) && (operatorType != OPERATOR_D1) && (operatorType != OPERATOR_D2) && (operatorType != OPERATOR_D3) && (operatorType != OPERATOR_D4) && (operatorType != OPERATOR_D5) && (operatorType != OPERATOR_D6) && (operatorType != OPERATOR_D7) && (operatorType != OPERATOR_D8) && (operatorType != OPERATOR_D9) && (operatorType != OPERATOR_D10) ), std::invalid_argument, ">>> ERROR (Basis_HCURL_HEX_In_FEM): Invalid operator type"); } }
void Basis_HDIV_HEX_In_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar & outputValues, const ArrayScalar & inputPoints, const EOperator operatorType) const { // Verify arguments #ifdef HAVE_INTREPID2_DEBUG Intrepid2::getValues_HDIV_Args<Scalar, ArrayScalar>(outputValues, inputPoints, operatorType, this -> getBaseCellTopology(), this -> getCardinality() ); #endif // Number of evaluation points = dim 0 of inputPoints int dim0 = inputPoints.dimension(0); // separate out points ArrayScalar xPoints(dim0,1); ArrayScalar yPoints(dim0,1); ArrayScalar zPoints(dim0,1); for (int i=0;i<dim0;i++) { xPoints(i,0) = inputPoints(i,0); yPoints(i,0) = inputPoints(i,1); zPoints(i,0) = inputPoints(i,2); } switch (operatorType) { case OPERATOR_VALUE: { ArrayScalar closedBasisValsXPts( closedBasis_.getCardinality() , dim0 ); ArrayScalar closedBasisValsYPts( closedBasis_.getCardinality() , dim0 ); ArrayScalar closedBasisValsZPts( closedBasis_.getCardinality() , dim0 ); ArrayScalar openBasisValsXPts( openBasis_.getCardinality() , dim0 ); ArrayScalar openBasisValsYPts( openBasis_.getCardinality() , dim0 ); ArrayScalar openBasisValsZPts( openBasis_.getCardinality() , dim0 ); closedBasis_.getValues( closedBasisValsXPts , xPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsYPts , yPoints , OPERATOR_VALUE ); closedBasis_.getValues( closedBasisValsZPts , zPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsZPts , zPoints , OPERATOR_VALUE ); int bfcur = 0; // x component bfs are (closed(x) open(y) open(z),0,0) for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = closedBasisValsXPts(i,l) * openBasisValsYPts(j,l) * openBasisValsZPts(k,l); outputValues(bfcur,l,1) = 0.0; outputValues(bfcur,l,2) = 0.0; } bfcur++; } } } // y component bfs are (0,open(x) closed(y) open(z),0) for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = 0.0; outputValues(bfcur,l,1) = openBasisValsXPts(i,l) * closedBasisValsYPts(j,l) * openBasisValsZPts(k,l); outputValues(bfcur,l,2) = 0.0; } bfcur++; } } } // z component bfs are (0,0,open(x) open(y) closed(z)) for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l,0) = 0.0; outputValues(bfcur,l,1) = 0.0; outputValues(bfcur,l,2) = openBasisValsXPts(i,l) * openBasisValsYPts(j,l) * closedBasisValsZPts(k,l); } bfcur++; } } } } break; case OPERATOR_DIV: { ArrayScalar closedBasisDerivsXPts( closedBasis_.getCardinality() , dim0 , 1 ); ArrayScalar closedBasisDerivsYPts( closedBasis_.getCardinality() , dim0 , 1 ); ArrayScalar closedBasisDerivsZPts( closedBasis_.getCardinality() , dim0 , 1 ); ArrayScalar openBasisValsXPts( openBasis_.getCardinality() , dim0 ); ArrayScalar openBasisValsYPts( openBasis_.getCardinality() , dim0 ); ArrayScalar openBasisValsZPts( openBasis_.getCardinality() , dim0 ); closedBasis_.getValues( closedBasisDerivsXPts , xPoints , OPERATOR_D1 ); closedBasis_.getValues( closedBasisDerivsYPts , yPoints , OPERATOR_D1 ); closedBasis_.getValues( closedBasisDerivsZPts , zPoints , OPERATOR_D1 ); openBasis_.getValues( openBasisValsXPts , xPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsYPts , yPoints , OPERATOR_VALUE ); openBasis_.getValues( openBasisValsZPts , zPoints , OPERATOR_VALUE ); int bfcur = 0; // x component basis functions first for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<closedBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l) = closedBasisDerivsXPts(i,l,0) * openBasisValsYPts(j,l) * openBasisValsZPts(k,l); } bfcur++; } } } // now y component basis functions for (int k=0;k<openBasis_.getCardinality();k++) { for (int j=0;j<closedBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l) = openBasisValsXPts(i,l) * closedBasisDerivsYPts(j,l,0) * openBasisValsZPts(k,l); } bfcur++; } } } // now z component basis functions for (int k=0;k<closedBasis_.getCardinality();k++) { for (int j=0;j<openBasis_.getCardinality();j++) { for (int i=0;i<openBasis_.getCardinality();i++) { for (int l=0;l<dim0;l++) { outputValues(bfcur,l) = openBasisValsXPts(i,l) * openBasisValsYPts(j,l) * closedBasisDerivsZPts(k,l,0); } bfcur++; } } } } break; case OPERATOR_CURL: TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_CURL), std::invalid_argument, ">>> ERROR (Basis_HDIV_HEX_In_FEM): CURL is invalid operator for HDIV Basis Functions"); break; case OPERATOR_GRAD: TEUCHOS_TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument, ">>> ERROR (Basis_HDIV_HEX_In_FEM): GRAD is invalid operator for HDIV Basis Functions"); break; case OPERATOR_D1: case OPERATOR_D2: case OPERATOR_D3: case OPERATOR_D4: case OPERATOR_D5: case OPERATOR_D6: case OPERATOR_D7: case OPERATOR_D8: case OPERATOR_D9: case OPERATOR_D10: TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) || (operatorType == OPERATOR_D2) || (operatorType == OPERATOR_D3) || (operatorType == OPERATOR_D4) || (operatorType == OPERATOR_D5) || (operatorType == OPERATOR_D6) || (operatorType == OPERATOR_D7) || (operatorType == OPERATOR_D8) || (operatorType == OPERATOR_D9) || (operatorType == OPERATOR_D10) ), std::invalid_argument, ">>> ERROR (Basis_HDIV_HEX_In_FEM): Invalid operator type"); break; default: TEUCHOS_TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) && (operatorType != OPERATOR_GRAD) && (operatorType != OPERATOR_CURL) && (operatorType != OPERATOR_DIV) && (operatorType != OPERATOR_D1) && (operatorType != OPERATOR_D2) && (operatorType != OPERATOR_D3) && (operatorType != OPERATOR_D4) && (operatorType != OPERATOR_D5) && (operatorType != OPERATOR_D6) && (operatorType != OPERATOR_D7) && (operatorType != OPERATOR_D8) && (operatorType != OPERATOR_D9) && (operatorType != OPERATOR_D10) ), std::invalid_argument, ">>> ERROR (Basis_HDIV_HEX_In_FEM): Invalid operator type"); } }