92 const EOperator operatorType,
98#ifdef HAVE_INTREPID_DEBUG
99 TEUCHOS_TEST_FOR_EXCEPTION( !( (0 <= fieldRank) && (fieldRank <= 2) ),
100 std::invalid_argument,
101 ">>> ERROR (Intrepid::getOperatorRank): Invalid field rank");
102 TEUCHOS_TEST_FOR_EXCEPTION( !( (1 <= spaceDim ) && (spaceDim <= 3) ),
103 std::invalid_argument,
104 ">>> ERROR (Intrepid::getOperatorRank): Invalid space dimension");
106 int operatorRank = -999;
113 if(operatorType == OPERATOR_VALUE) {
123 TEUCHOS_TEST_FOR_EXCEPTION( ( fieldRank > 0 ),
124 std::invalid_argument,
125 ">>> ERROR (getOperatorRank): Only scalar fields are allowed in 1D");
131 switch(operatorType) {
154 operatorRank = spaceDim - 3;
160 operatorRank = 3 - spaceDim;
165 TEUCHOS_TEST_FOR_EXCEPTION( ( (spaceDim == 3) && (fieldRank == 0) ), std::invalid_argument,
166 ">>> ERROR (Intrepid::getOperatorRank): CURL cannot be applied to scalar fields in 3D");
180 TEUCHOS_TEST_FOR_EXCEPTION( ( (spaceDim > 1) && (fieldRank == 0) ), std::invalid_argument,
181 ">>> ERROR (Intrepid::getOperatorRank): DIV cannot be applied to scalar fields in 2D and 3D");
186 TEUCHOS_TEST_FOR_EXCEPTION( !(
isValidOperator(operatorType) ), std::invalid_argument,
187 ">>> ERROR (Intrepid::getOperatorRank): Invalid operator type");
238 if( (yMult < 0) && (zMult < 0)) {
240#ifdef HAVE_INTREPID_DEBUG
243 ">>> ERROR (Intrepid::getDkEnumeration): Derivative order out of range");
252#ifdef HAVE_INTREPID_DEBUG
254 TEUCHOS_TEST_FOR_EXCEPTION( !( (0 <= xMult) && (0 <= yMult) &&
256 ">>> ERROR (Intrepid::getDkEnumeration): Derivative order out of range");
265 int order = xMult + yMult + zMult;
267#ifdef HAVE_INTREPID_DEBUG
269 TEUCHOS_TEST_FOR_EXCEPTION( !( (0 <= xMult) && (0 <= yMult) && (0 <= zMult) &&
271 ">>> ERROR (Intrepid::getDkEnumeration): Derivative order out of range");
273 int enumeration = zMult;
274 for(
int i = 0; i < order - xMult + 1; i++){
285 const int derivativeEnum,
286 const EOperator operatorType,
287 const int spaceDim) {
302 static const int binNumber[66] = {
310 7, 7, 7, 7, 7, 7, 7, 7,
311 8, 8, 8, 8, 8, 8, 8, 8, 8,
312 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
313 10,10,10,10,10,10,10,10,10,10,10
317 static const int binBegin[66] ={
324 21,21,21,21,21,21,21,
325 28,28,28,28,28,28,28,28,
326 36,36,36,36,36,36,36,36,36,
327 45,45,45,45,45,45,45,45,45,45,
328 55,55,55,55,55,55,55,55,55,55,55
331#ifdef HAVE_INTREPID_DEBUG
333 TEUCHOS_TEST_FOR_EXCEPTION( !( (0 <= derivativeEnum) && (derivativeEnum <
getDkCardinality(operatorType,spaceDim) ) ),
334 std::invalid_argument,
335 ">>> ERROR (Intrepid::getDkMultiplicities): Invalid derivative enumeration value for this order and space dimension");
340 switch(operatorType){
356 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
357 ">>> ERROR (Intrepid::getDkMultiplicities): operator type Dk required for this method");
365 partialMult.resize(1);
368 partialMult[0] = derivativeOrder;
374 partialMult.resize(2);
377 partialMult[1] = derivativeEnum;
378 partialMult[0] = derivativeOrder - derivativeEnum;
384 partialMult.resize(3);
387 partialMult[0] = derivativeOrder - binNumber[derivativeEnum];
388 partialMult[1] = binNumber[derivativeEnum] + binBegin[derivativeEnum] - derivativeEnum;
389 partialMult[2] = derivativeEnum - binBegin[derivativeEnum];
393 TEUCHOS_TEST_FOR_EXCEPTION( !( (0 < spaceDim ) && (spaceDim < 4) ), std::invalid_argument,
394 ">>> ERROR (Intrepid::getDkMultiplicities): Invalid space dimension");
456 std::vector<std::vector<int> > &ordinalToTag,
462 const int posDfOrd) {
466 ordinalToTag.resize(basisCard);
467 for (
int i = 0; i < basisCard; i++) {
468 ordinalToTag[i].resize(4);
469 for (
int j = 0; j < tagSize; j++) {
470 ordinalToTag[i][j] = tags[i*tagSize + j];
477 for (
int i = 0; i < basisCard; i++) {
478 if (maxScDim < tags[i*tagSize + posScDim]) {
479 maxScDim = tags[i*tagSize + posScDim];
486 for (
int i = 0; i < basisCard; i++) {
487 if (maxScOrd < tags[i*tagSize + posScOrd]) {
488 maxScOrd = tags[i*tagSize + posScOrd];
495 for (
int i = 0; i < basisCard; i++) {
496 if (maxDfOrd < tags[i*tagSize + posDfOrd]) {
497 maxDfOrd = tags[i*tagSize + posDfOrd];
503 std::vector<int> rank1Array(maxDfOrd, -1);
506 std::vector<std::vector<int> > rank2Array(maxScOrd, rank1Array);
509 tagToOrdinal.assign(maxScDim, rank2Array);
512 for (
int i = 0; i < basisCard; i++) {
513 tagToOrdinal[tags[i*tagSize]][tags[i*tagSize+1]][tags[i*tagSize+2]] = i;
void setOrdinalTagData(std::vector< std::vector< std::vector< int > > > &tagToOrdinal, std::vector< std::vector< int > > &ordinalToTag, const int *tags, const int basisCard, const int tagSize, const int posScDim, const int posScOrd, const int posDfOrd)
Fills ordinalToTag_ and tagToOrdinal_ by basis-specific tag data.
void getDkMultiplicities(Teuchos::Array< int > &partialMult, const int derivativeEnum, const EOperator operatorType, const int spaceDim)
Returns multiplicities of dx, dy, and dz based on the enumeration of the partial derivative,...