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