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_TRI_I1_FEM<Scalar,ArrayScalar>::Basis_HCURL_TRI_I1_FEM()
00040 {
00041 this -> basisCardinality_ = 3;
00042 this -> basisDegree_ = 1;
00043 this -> basisCellTopology_ = shards::CellTopology(shards::getCellTopologyData<shards::Triangle<3> >() );
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_TRI_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
00064
00065 Intrepid::setOrdinalTagData(this -> tagToOrdinal_,
00066 this -> ordinalToTag_,
00067 tags,
00068 this -> basisCardinality_,
00069 tagSize,
00070 posScDim,
00071 posScOrd,
00072 posDfOrd);
00073 }
00074
00075
00076
00077 template<class Scalar, class ArrayScalar>
00078 void Basis_HCURL_TRI_I1_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar & outputValues,
00079 const ArrayScalar & inputPoints,
00080 const EOperator operatorType) const {
00081
00082
00083 #ifdef HAVE_INTREPID_DEBUG
00084 Intrepid::getValues_HCURL_Args<Scalar, ArrayScalar>(outputValues,
00085 inputPoints,
00086 operatorType,
00087 this -> getBaseCellTopology(),
00088 this -> getCardinality() );
00089 #endif
00090
00091
00092 int dim0 = inputPoints.dimension(0);
00093
00094
00095 Scalar x = 0.0;
00096 Scalar y = 0.0;
00097
00098 switch (operatorType) {
00099 case OPERATOR_VALUE:
00100 for (int i0 = 0; i0 < dim0; i0++) {
00101 x = inputPoints(i0, 0);
00102 y = inputPoints(i0, 1);
00103
00104
00105 outputValues(0, i0, 0) = 1.0 - y;
00106 outputValues(0, i0, 1) = x;
00107
00108 outputValues(1, i0, 0) = -y;
00109 outputValues(1, i0, 1) = x;
00110
00111 outputValues(2, i0, 0) = -y;
00112 outputValues(2, i0, 1) = -1.0 + x;
00113 }
00114 break;
00115
00116 case OPERATOR_CURL:
00117 for (int i0 = 0; i0 < dim0; i0++) {
00118 x = inputPoints(i0, 0);
00119 y = inputPoints(i0, 1);
00120
00121
00122 outputValues(0, i0) = 2.0;
00123 outputValues(1, i0) = 2.0;
00124 outputValues(2, i0) = 2.0;
00125 }
00126 break;
00127
00128 case OPERATOR_DIV:
00129 TEST_FOR_EXCEPTION( (operatorType == OPERATOR_DIV), std::invalid_argument,
00130 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): DIV is invalid operator for HCURL Basis Functions");
00131 break;
00132
00133 case OPERATOR_GRAD:
00134 TEST_FOR_EXCEPTION( (operatorType == OPERATOR_GRAD), std::invalid_argument,
00135 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): GRAD is invalid operator for HCURL Basis Functions");
00136 break;
00137
00138 case OPERATOR_D1:
00139 case OPERATOR_D2:
00140 case OPERATOR_D3:
00141 case OPERATOR_D4:
00142 case OPERATOR_D5:
00143 case OPERATOR_D6:
00144 case OPERATOR_D7:
00145 case OPERATOR_D8:
00146 case OPERATOR_D9:
00147 case OPERATOR_D10:
00148 TEST_FOR_EXCEPTION( ( (operatorType == OPERATOR_D1) ||
00149 (operatorType == OPERATOR_D2) ||
00150 (operatorType == OPERATOR_D3) ||
00151 (operatorType == OPERATOR_D4) ||
00152 (operatorType == OPERATOR_D5) ||
00153 (operatorType == OPERATOR_D6) ||
00154 (operatorType == OPERATOR_D7) ||
00155 (operatorType == OPERATOR_D8) ||
00156 (operatorType == OPERATOR_D9) ||
00157 (operatorType == OPERATOR_D10) ),
00158 std::invalid_argument,
00159 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): Invalid operator type");
00160 break;
00161
00162 default:
00163 TEST_FOR_EXCEPTION( ( (operatorType != OPERATOR_VALUE) &&
00164 (operatorType != OPERATOR_GRAD) &&
00165 (operatorType != OPERATOR_CURL) &&
00166 (operatorType != OPERATOR_DIV) &&
00167 (operatorType != OPERATOR_D1) &&
00168 (operatorType != OPERATOR_D2) &&
00169 (operatorType != OPERATOR_D3) &&
00170 (operatorType != OPERATOR_D4) &&
00171 (operatorType != OPERATOR_D5) &&
00172 (operatorType != OPERATOR_D6) &&
00173 (operatorType != OPERATOR_D7) &&
00174 (operatorType != OPERATOR_D8) &&
00175 (operatorType != OPERATOR_D9) &&
00176 (operatorType != OPERATOR_D10) ),
00177 std::invalid_argument,
00178 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): Invalid operator type");
00179 }
00180 }
00181
00182
00183
00184 template<class Scalar, class ArrayScalar>
00185 void Basis_HCURL_TRI_I1_FEM<Scalar, ArrayScalar>::getValues(ArrayScalar& outputValues,
00186 const ArrayScalar & inputPoints,
00187 const ArrayScalar & cellVertices,
00188 const EOperator operatorType) const {
00189 TEST_FOR_EXCEPTION( (true), std::logic_error,
00190 ">>> ERROR (Basis_HCURL_TRI_I1_FEM): FEM Basis calling an FVD member function");
00191 }
00192
00193 }