00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00036 namespace Intrepid {
00037
00038 template<class Scalar, class ArrayScalar>
00039 Basis_HCURL_QUAD_I1_FEM<Scalar,ArrayScalar>::Basis_HCURL_QUAD_I1_FEM()
00040 {
00041 this -> basisCardinality_ = 4;
00042 this -> basisDegree_ = 1;
00043 this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Quadrilateral<4> >() );
00044 this -> basisType_ = BASIS_FEM_DEFAULT;
00045 this -> basisCoordinates_ = COORDINATES_CARTESIAN;
00046 this -> basisTagsAreSet_ = false;
00047 }
00048
00049 template<class Scalar, class ArrayScalar>
00050 void Basis_HCURL_QUAD_I1_FEM<Scalar, ArrayScalar>::initializeTags() {
00051
00052
00053 int tagSize = 4;
00054 int posScDim = 0;
00055 int posScOrd = 1;
00056 int posDfOrd = 2;
00057
00058
00059 int tags[] = {
00060 1, 0, 0, 1,
00061 1, 1, 0, 1,
00062 1, 2, 0, 1,
00063 1, 3, 0, 1};
00064
00065
00066 Intrepid::setOrdinalTagData(this -> tagToOrdinal_,
00067 this -> ordinalToTag_,
00068 tags,
00069 this -> basisCardinality_,
00070 tagSize,
00071 posScDim,
00072 posScOrd,
00073 posDfOrd);
00074 }
00075
00076
00077
00078 template<class Scalar, class ArrayScalar>
00079 void Basis_HCURL_QUAD_I1_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar & outputValues,
00080 const ArrayScalar & inputPoints,
00081 const EOperator operatorType) const {
00082
00083
00084 #ifdef HAVE_INTREPID_DEBUG
00085 Intrepid::getValues_HCURL_Args<Scalar, ArrayScalar>(outputValues,
00086 inputPoints,
00087 operatorType,
00088 this -> getBaseCellTopology(),
00089 this -> getCardinality() );
00090 #endif
00091
00092
00093 int dim0 = inputPoints.dimension(0);
00094
00095
00096 Scalar x = 0.0;
00097 Scalar y = 0.0;
00098
00099 switch (operatorType) {
00100 case OPERATOR_VALUE:
00101 for (int i0 = 0; i0 < dim0; i0++) {
00102 x = inputPoints(i0, 0);
00103 y = inputPoints(i0, 1);
00104
00105
00106 outputValues(0, i0, 0) = (1.0 - y)/4.0;
00107 outputValues(0, i0, 1) = 0.0;
00108
00109 outputValues(1, i0, 0) = 0.0;
00110 outputValues(1, i0, 1) = (1.0 + x)/4.0;
00111
00112 outputValues(2, i0, 0) =-(1.0 + y)/4.0;
00113 outputValues(2, i0, 1) = 0.0;
00114
00115 outputValues(3, i0, 0) = 0.0;
00116 outputValues(3, i0, 1) =-(1.0 - x)/4.0;
00117 }
00118 break;
00119
00120 case OPERATOR_CURL:
00121 for (int i0 = 0; i0 < dim0; i0++) {
00122
00123
00124 outputValues(0, i0) = 0.25;
00125 outputValues(1, i0) = 0.25;
00126 outputValues(2, i0) = 0.25;
00127 outputValues(3, i0) = 0.25;
00128 }
00129 break;
00130
00131 case OPERATOR_DIV:
00132 TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
00133 ">>> ERROR (Basis_HCURL_QUAD_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
00134 break;
00135
00136 case OPERATOR_GRAD:
00137 TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
00138 ">>> ERROR (Basis_HCURL_QUAD_I1_FEM): GRAD is invalid operator for HCURL Basis Functions");
00139 break;
00140
00141 case OPERATOR_D1:
00142 case OPERATOR_D2:
00143 case OPERATOR_D3:
00144 case OPERATOR_D4:
00145 case OPERATOR_D5:
00146 case OPERATOR_D6:
00147 case OPERATOR_D7:
00148 case OPERATOR_D8:
00149 case OPERATOR_D9:
00150 case OPERATOR_D10:
00151 TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
00152 (operatorType == OPERATOR_D2) ||
00153 (operatorType == OPERATOR_D3) ||
00154 (operatorType == OPERATOR_D4) ||
00155 (operatorType == OPERATOR_D5) ||
00156 (operatorType == OPERATOR_D6) ||
00157 (operatorType == OPERATOR_D7) ||
00158 (operatorType == OPERATOR_D8) ||
00159 (operatorType == OPERATOR_D9) ||
00160 (operatorType == OPERATOR_D10) ),
00161 std::invalid_argument,
00162 ">>> ERROR (Basis_HCURL_QUAD_I1_FEM): Invalid operator type");
00163 break;
00164
00165 default:
00166 TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
00167 (operatorType != OPERATOR_GRAD) &&
00168 (operatorType != OPERATOR_CURL) &&
00169 (operatorType != OPERATOR_DIV) &&
00170 (operatorType != OPERATOR_D1) &&
00171 (operatorType != OPERATOR_D2) &&
00172 (operatorType != OPERATOR_D3) &&
00173 (operatorType != OPERATOR_D4) &&
00174 (operatorType != OPERATOR_D5) &&
00175 (operatorType != OPERATOR_D6) &&
00176 (operatorType != OPERATOR_D7) &&
00177 (operatorType != OPERATOR_D8) &&
00178 (operatorType != OPERATOR_D9) &&
00179 (operatorType != OPERATOR_D10) ),
00180 std::invalid_argument,
00181 ">>> ERROR (Basis_HCURL_QUAD_I1_FEM): Invalid operator type");
00182 }
00183 }
00184
00185
00186
00187 template<class Scalar, class ArrayScalar>
00188 void Basis_HCURL_QUAD_I1_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar& outputValues,
00189 const ArrayScalar & inputPoints,
00190 const ArrayScalar & cellVertices,
00191 const EOperator operatorType) const {
00192 TEST_FOR_EXCEPTION( (true), std::logic_error,
00193 ">>> ERROR (Basis_HCURL_QUAD_I1_FEM): FEM Basis calling an FVD member function");
00194 }
00195
00196 }