51 template<
class Scalar,
56 const ArrayInData & inputData,
57 const ArrayInFields & inputFields){
58 #ifdef HAVE_INTREPID_DEBUG
59 std::string errmsg =
">>> ERROR (ArrayTools::crossProductDataField):";
67 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputData, 3, 3),
68 std::invalid_argument, errmsg);
69 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 2, 2,3),
70 std::invalid_argument, errmsg);
72 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputFields, 3,4), std::invalid_argument, errmsg);
73 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputFields, getrank(inputFields)-1, 2,3),
74 std::invalid_argument, errmsg);
76 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputFields, inputData.dimension(2)+1, inputData.dimension(2)+1),
77 std::invalid_argument, errmsg);
86 if( getrank(inputFields) == 4) {
88 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputData, 0,1,2, inputFields, 0,2,3),
89 std::invalid_argument, errmsg);
93 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputData, 1,2, inputFields, 1,2),
94 std::invalid_argument, errmsg);
99 if(inputData.dimension(2) == 2) {
101 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, 0,2, inputData, 0,1),
102 std::invalid_argument, errmsg);
106 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, 0,2,3, inputData, 0,1,2),
107 std::invalid_argument, errmsg);
112 if(inputData.dimension(2) == 2) {
114 if(getrank(inputFields) == 4){
116 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, 0,1,2, inputFields, 0,1,2),
117 std::invalid_argument, errmsg);
121 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, 1,2, inputFields, 0,1),
122 std::invalid_argument, errmsg);
127 if(getrank(inputFields) == 4){
129 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, inputFields),
130 std::invalid_argument, errmsg);
134 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, 1,2,3, inputFields, 0,1,2),
135 std::invalid_argument, errmsg);
144 if(inputData.dimension(2) == 3) {
147 if(getrank(inputFields) == 4){
149 for(
size_t cell = 0; cell < static_cast<size_t>(outputFields.dimension(0)); cell++){
150 for(
size_t field = 0; field < static_cast<size_t>(outputFields.dimension(1)); field++){
151 for(
size_t point = 0; point < static_cast<size_t>(outputFields.dimension(2)); point++){
153 outputFieldsWrap(cell, field, point, 0) = \
154 inputDataWrap(cell, point, 1)*inputFieldsWrap(cell, field, point, 2) -
155 inputDataWrap(cell, point, 2)*inputFieldsWrap(cell, field, point, 1);
157 outputFieldsWrap(cell, field, point, 1) = \
158 inputDataWrap(cell, point, 2)*inputFieldsWrap(cell, field, point, 0) -
159 inputDataWrap(cell, point, 0)*inputFieldsWrap(cell, field, point, 2);
161 outputFieldsWrap(cell, field, point, 2) = \
162 inputDataWrap(cell, point, 0)*inputFieldsWrap(cell, field, point, 1) -
163 inputDataWrap(cell, point, 1)*inputFieldsWrap(cell, field, point, 0);
169 else if(getrank(inputFields) == 3){
171 for(
size_t cell = 0; cell < static_cast<size_t>(outputFields.dimension(0)); cell++){
172 for(
size_t field = 0; field < static_cast<size_t>(outputFields.dimension(1)); field++){
173 for(
size_t point = 0; point < static_cast<size_t>(outputFields.dimension(2)); point++){
175 outputFieldsWrap(cell, field, point, 0) = \
176 inputDataWrap(cell, point, 1)*inputFieldsWrap(field, point, 2) -
177 inputDataWrap(cell, point, 2)*inputFieldsWrap(field, point, 1);
179 outputFieldsWrap(cell, field, point, 1) = \
180 inputDataWrap(cell, point, 2)*inputFieldsWrap(field, point, 0) -
181 inputDataWrap(cell, point, 0)*inputFieldsWrap(field, point, 2);
183 outputFieldsWrap(cell, field, point, 2) = \
184 inputDataWrap(cell, point, 0)*inputFieldsWrap(field, point, 1) -
185 inputDataWrap(cell, point, 1)*inputFieldsWrap(field, point, 0);
191 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
192 ">>> ERROR (ArrayTools::crossProductDataField): inputFields rank 3 or 4 required.")
196 else if(inputData.dimension(2) == 2){
199 if(getrank(inputFields) == 4){
201 for(
size_t cell = 0; cell < static_cast<size_t>(outputFields.dimension(0)); cell++){
202 for(
size_t field = 0; field < static_cast<size_t>(outputFields.dimension(1)); field++){
203 for(
size_t point = 0; point < static_cast<size_t>(outputFields.dimension(2)); point++){
204 outputFieldsWrap(cell, field, point) = \
205 inputDataWrap(cell, point, 0)*inputFieldsWrap(cell, field, point, 1) -
206 inputDataWrap(cell, point, 1)*inputFieldsWrap(cell, field, point, 0);
212 else if(getrank(inputFields) == 3) {
214 for(
size_t cell = 0; cell < static_cast<size_t>(outputFields.dimension(0)); cell++){
215 for(
size_t field = 0; field < static_cast<size_t>(outputFields.dimension(1)); field++){
216 for(
size_t point = 0; point < static_cast<size_t>(outputFields.dimension(2)); point++){
217 outputFieldsWrap(cell, field, point) = \
218 inputDataWrap(cell, point, 0)*inputFieldsWrap(field, point, 1) -
219 inputDataWrap(cell, point, 1)*inputFieldsWrap(field, point, 0);
227 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
228 ">>> ERROR (ArrayTools::crossProductDataField): spatial dimension 2 or 3 required.")
234 template<
class Scalar,
236 class ArrayInDataLeft,
237 class ArrayInDataRight>
239 const ArrayInDataLeft & inputDataLeft,
240 const ArrayInDataRight & inputDataRight){
243 #ifdef HAVE_INTREPID_DEBUG
244 std::string errmsg =
">>> ERROR (ArrayTools::crossProductDataData):";
252 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataLeft, 3,3),
253 std::invalid_argument, errmsg);
254 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 2, 2,3),
255 std::invalid_argument, errmsg);
257 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataRight, 2,3),
258 std::invalid_argument, errmsg);
259 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataRight, getrank(inputDataRight)-1, 2,3),
260 std::invalid_argument, errmsg);
262 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputData, inputDataLeft.dimension(2), inputDataLeft.dimension(2)),
263 std::invalid_argument, errmsg);
272 if( getrank(inputDataRight) == 3) {
274 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputDataLeft, inputDataRight),
275 std::invalid_argument, errmsg);
279 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputDataLeft, 1,2, inputDataRight, 0,1),
280 std::invalid_argument, errmsg);
285 if(inputDataLeft.dimension(2) == 2){
287 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputDataLeft, 0,1, outputData, 0,1),
288 std::invalid_argument, errmsg);
292 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputDataLeft, outputData),
293 std::invalid_argument, errmsg);
298 if(inputDataLeft.dimension(2) == 2) {
300 if(getrank(inputDataRight) == 3){
302 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, 0,1, inputDataRight, 0,1),
303 std::invalid_argument, errmsg);
307 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, 1, inputDataRight, 0),
308 std::invalid_argument, errmsg);
313 if(getrank(inputDataRight) == 3){
315 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, inputDataRight),
316 std::invalid_argument, errmsg);
320 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, 1,2, inputDataRight, 0,1),
321 std::invalid_argument, errmsg);
331 if(inputDataLeft.dimension(2) == 3) {
334 if(getrank(inputDataRight) == 3){
336 for(
size_t cell = 0; cell < (size_t)inputDataLeft.dimension(0); cell++){
337 for(
size_t point = 0; point < (size_t)inputDataLeft.dimension(1); point++){
339 outputDataWrap(cell, point, 0) = \
340 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(cell, point, 2) -
341 inputDataLeftWrap(cell, point, 2)*inputDataRightWrap(cell, point, 1);
343 outputDataWrap(cell, point, 1) = \
344 inputDataLeftWrap(cell, point, 2)*inputDataRightWrap(cell, point, 0) -
345 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(cell, point, 2);
347 outputDataWrap(cell, point, 2) = \
348 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(cell, point, 1) -
349 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(cell, point, 0);
354 else if(getrank(inputDataRight) == 2){
356 for(
size_t cell = 0; cell < (size_t)inputDataLeft.dimension(0); cell++){
357 for(
size_t point = 0; point < (size_t)inputDataLeft.dimension(1); point++){
359 outputDataWrap(cell, point, 0) = \
360 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(point, 2) -
361 inputDataLeftWrap(cell, point, 2)*inputDataRightWrap(point, 1);
363 outputDataWrap(cell, point, 1) = \
364 inputDataLeftWrap(cell, point, 2)*inputDataRightWrap(point, 0) -
365 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(point, 2);
367 outputDataWrap(cell, point, 2) = \
368 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(point, 1) -
369 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(point, 0);
374 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
375 ">>> ERROR (ArrayTools::crossProductDataData): inputDataRight rank 2 or 3 required.")
379 else if(inputDataLeft.dimension(2) == 2){
382 if(getrank(inputDataRight) == 3){
384 for(
size_t cell = 0; cell < (size_t)inputDataLeft.dimension(0); cell++){
385 for(
size_t point = 0; point < (size_t)inputDataLeft.dimension(1); point++){
386 outputDataWrap(cell, point) = \
387 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(cell, point, 1) -
388 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(cell, point, 0);
393 else if(getrank(inputDataRight) == 2) {
395 for(
size_t cell = 0; cell < (size_t)inputDataLeft.dimension(0); cell++){
396 for(
size_t point = 0; point < (size_t)inputDataLeft.dimension(1); point++){
397 outputDataWrap(cell, point) = \
398 inputDataLeftWrap(cell, point, 0)*inputDataRightWrap(point, 1) -
399 inputDataLeftWrap(cell, point, 1)*inputDataRightWrap(point, 0);
406 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
407 ">>> ERROR (ArrayTools::crossProductDataData): spatial dimension 2 or 3 required.")
413 template<
class Scalar,
414 class ArrayOutFields,
418 const ArrayInData & inputData,
419 const ArrayInFields & inputFields){
421 #ifdef HAVE_INTREPID_DEBUG
422 std::string errmsg =
">>> ERROR (ArrayTools::outerProductDataField):";
430 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputData, 3,3),
431 std::invalid_argument, errmsg);
432 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 2, 2,3),
433 std::invalid_argument, errmsg);
435 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputFields, 3,4), std::invalid_argument, errmsg);
436 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputFields, getrank(inputFields)-1, 2,3),
437 std::invalid_argument, errmsg);
439 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputFields, 5,5), std::invalid_argument, errmsg);
440 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputFields, 3, 2,3),
441 std::invalid_argument, errmsg);
442 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputFields, 4, 2,3),
443 std::invalid_argument, errmsg);
452 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
453 outputFields, 0,2,3,4,
455 std::invalid_argument, errmsg);
459 if( getrank(inputFields) == 4) {
461 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
464 std::invalid_argument, errmsg);
466 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
467 outputFields, 0,1,2,3,4,
468 inputFields, 0,1,2,3,3),
469 std::invalid_argument, errmsg);
473 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
476 std::invalid_argument, errmsg);
478 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
479 outputFields, 1,2,3,4,
480 inputFields, 0,1,2,2),
481 std::invalid_argument, errmsg);
489 if(getrank(inputFields) == 4){
491 for(
size_t cell = 0; cell < (size_t)outputFields.dimension(0); cell++){
492 for(
size_t field = 0; field < (size_t)outputFields.dimension(1); field++){
493 for(
size_t point = 0; point < (size_t)outputFields.dimension(2); point++){
494 for(
size_t row = 0; row < (size_t)outputFields.dimension(3); row++){
495 for(
size_t col = 0; col < (size_t)outputFields.dimension(4); col++){
496 outputFieldsWrap(cell, field, point, row, col) = \
497 inputDataWrap(cell, point, row)*inputFieldsWrap(cell, field, point, col);
505 else if(getrank(inputFields) == 3){
507 for(
size_t cell = 0; cell < (size_t)outputFields.dimension(0); cell++){
508 for(
size_t field = 0; field < (size_t)outputFields.dimension(1); field++){
509 for(
size_t point = 0; point < (size_t)outputFields.dimension(2); point++){
510 for(
size_t row = 0; row < (size_t)outputFields.dimension(3); row++){
511 for(
size_t col = 0; col < (size_t)outputFields.dimension(4); col++){
512 outputFieldsWrap(cell, field, point, row, col) = \
513 inputDataWrap(cell, point, row)*inputFieldsWrap(field, point, col);
521 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
522 ">>> ERROR (ArrayTools::outerProductDataField): inputFields rank 3 or 4 required.")
528 template<
class Scalar,
530 class ArrayInDataLeft,
531 class ArrayInDataRight>
533 const ArrayInDataLeft & inputDataLeft,
534 const ArrayInDataRight & inputDataRight){
536 #ifdef HAVE_INTREPID_DEBUG
537 std::string errmsg =
">>> ERROR (ArrayTools::outerProductDataData):";
545 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataLeft, 3,3),
546 std::invalid_argument, errmsg);
547 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 2, 2,3),
548 std::invalid_argument, errmsg);
550 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataRight, 2,3),
551 std::invalid_argument, errmsg);
552 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataRight, getrank(inputDataRight)-1, 2,3),
553 std::invalid_argument, errmsg);
555 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputData, 4, 4), std::invalid_argument, errmsg);
556 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputData, 2, 2,3),
557 std::invalid_argument, errmsg);
558 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputData, 3, 2,3),
559 std::invalid_argument, errmsg);
568 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
570 inputDataLeft, 0,1,2,2),
571 std::invalid_argument, errmsg);
575 if( getrank(inputDataRight) == 3) {
577 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, inputDataLeft, inputDataRight),
578 std::invalid_argument, errmsg);
580 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
582 inputDataRight, 0,1,2,2),
583 std::invalid_argument, errmsg);
587 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
589 inputDataRight, 0,1),
590 std::invalid_argument, errmsg);
592 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
594 inputDataRight, 0,1,1),
595 std::invalid_argument, errmsg);
604 if(getrank(inputDataRight) == 3){
606 for(
size_t cell = 0; cell <(size_t) inputDataLeft.dimension(0); cell++){
607 for(
size_t point = 0; point <(size_t) inputDataLeft.dimension(1); point++){
608 for(
size_t row = 0; row <(size_t) inputDataLeft.dimension(2); row++){
609 for(
size_t col = 0; col <(size_t) inputDataLeft.dimension(2); col++){
611 outputDataWrap(cell, point, row, col) = \
612 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(cell, point, col);
619 else if(getrank(inputDataRight) == 2){
621 for(
size_t cell = 0; cell <(size_t) inputDataLeft.dimension(0); cell++){
622 for(
size_t point = 0; point <(size_t) inputDataLeft.dimension(1); point++){
623 for(
size_t row = 0; row <(size_t) inputDataLeft.dimension(2); row++){
624 for(
size_t col = 0; col <(size_t) inputDataLeft.dimension(2); col++){
626 outputDataWrap(cell, point, row, col) = \
627 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(point, col);
634 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
635 ">>> ERROR (ArrayTools::crossProductDataData): inputDataRight rank 2 or 3 required.")
638 template<
class Scalar,
639 class ArrayOutFields,
643 const ArrayInData & inputData,
644 const ArrayInFields & inputFields,
645 const char transpose){
647 #ifdef HAVE_INTREPID_DEBUG
648 std::string errmsg =
">>> ERROR (ArrayTools::matvecProductDataField):";
656 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputData, 2,4),
657 std::invalid_argument, errmsg);
658 if(getrank(inputData) > 2) {
659 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 2, 1,3),
660 std::invalid_argument, errmsg);
662 if(getrank(inputData) == 4) {
663 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 3, 1,3),
664 std::invalid_argument, errmsg);
667 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputFields, 3,4), std::invalid_argument, errmsg);
668 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputFields, getrank(inputFields)-1, 1,3),
669 std::invalid_argument, errmsg);
671 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputFields, 4,4), std::invalid_argument, errmsg);
672 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputFields, 3, 1,3),
673 std::invalid_argument, errmsg);
685 if(inputData.dimension(1) > 1){
686 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
689 std::invalid_argument, errmsg);
691 if(getrank(inputData) == 2) {
692 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
695 std::invalid_argument, errmsg);
697 if(getrank(inputData) == 3){
698 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
701 std::invalid_argument, errmsg);
704 if(getrank(inputData) == 4){
705 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
708 std::invalid_argument, errmsg);
713 if(getrank(inputFields) == 4) {
715 if(inputData.dimension(1) > 1){
716 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
719 std::invalid_argument, errmsg);
721 if(getrank(inputData) == 2){
722 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
725 std::invalid_argument, errmsg);
727 if(getrank(inputData) == 3){
728 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
731 std::invalid_argument, errmsg);
733 if(getrank(inputData) == 4){
734 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
737 std::invalid_argument, errmsg);
740 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, inputFields),
741 std::invalid_argument, errmsg);
745 if(inputData.dimension(1) > 1){
746 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
749 std::invalid_argument, errmsg);
751 if(getrank(inputData) == 3){
752 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
755 std::invalid_argument, errmsg);
757 if(getrank(inputData) == 4){
758 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
761 std::invalid_argument, errmsg);
764 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
767 std::invalid_argument, errmsg);
774 size_t dataRank = getrank(inputData);
775 size_t numDataPts = inputData.dimension(1);
776 size_t inRank = getrank(inputFields);
777 size_t numCells = outputFields.dimension(0);
778 size_t numFields = outputFields.dimension(1);
779 size_t numPoints = outputFields.dimension(2);
780 size_t matDim = outputFields.dimension(3);
789 for(
size_t cell = 0; cell < numCells; cell++) {
790 for(
size_t field = 0; field < numFields; field++) {
791 for(
size_t point = 0; point < numPoints; point++) {
792 for(
size_t row = 0; row < matDim; row++) {
793 outputFieldsWrap(cell, field, point, row) = \
794 inputDataWrap(cell, point)*inputFieldsWrap(cell, field, point, row);
802 for(
size_t cell = 0; cell < numCells; cell++) {
803 for(
size_t field = 0; field < numFields; field++) {
804 for(
size_t point = 0; point < numPoints; point++) {
805 for(
size_t row = 0; row < matDim; row++) {
806 outputFieldsWrap(cell, field, point, row) = \
807 inputDataWrap(cell, point, row)*inputFieldsWrap(cell, field, point, row);
815 if ((transpose ==
'n') || (transpose ==
'N')) {
816 for(
size_t cell = 0; cell < numCells; cell++){
817 for(
size_t field = 0; field < numFields; field++){
818 for(
size_t point = 0; point < numPoints; point++){
819 for(
size_t row = 0; row < matDim; row++){
820 outputFieldsWrap(cell, field, point, row) = 0.0;
821 for(
size_t col = 0; col < matDim; col++){
822 outputFieldsWrap(cell, field, point, row) += \
823 inputDataWrap(cell, point, row, col)*inputFieldsWrap(cell, field, point, col);
830 else if ((transpose ==
't') || (transpose ==
'T')) {
831 for(
size_t cell = 0; cell < numCells; cell++){
832 for(
size_t field = 0; field < numFields; field++){
833 for(
size_t point = 0; point < numPoints; point++){
834 for(
size_t row = 0; row < matDim; row++){
835 outputFieldsWrap(cell, field, point, row) = 0.0;
836 for(
size_t col = 0; col < matDim; col++){
837 outputFieldsWrap(cell, field, point, row) += \
838 inputDataWrap(cell, point, col, row)*inputFieldsWrap(cell, field, point, col);
846 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
847 ">>> ERROR (ArrayTools::matvecProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
852 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
853 ">>> ERROR (ArrayTools::matvecProductDataField): inputData rank 2, 3 or 4 required.")
859 for(
size_t cell = 0; cell < numCells; cell++) {
860 for(
size_t field = 0; field < numFields; field++) {
861 for(
size_t point = 0; point < numPoints; point++) {
862 for(
size_t row = 0; row < matDim; row++) {
863 outputFieldsWrap(cell, field, point, row) = \
864 inputDataWrap(cell, 0)*inputFieldsWrap(cell, field, point, row);
872 for(
size_t cell = 0; cell < numCells; cell++) {
873 for(
size_t field = 0; field < numFields; field++) {
874 for(
size_t point = 0; point < numPoints; point++) {
875 for(
size_t row = 0; row < matDim; row++) {
876 outputFieldsWrap(cell, field, point, row) = \
877 inputDataWrap(cell, 0, row)*inputFieldsWrap(cell, field, point, row);
885 if ((transpose ==
'n') || (transpose ==
'N')) {
886 for(
size_t cell = 0; cell < numCells; cell++){
887 for(
size_t field = 0; field < numFields; field++){
888 for(
size_t point = 0; point < numPoints; point++){
889 for(
size_t row = 0; row < matDim; row++){
890 outputFieldsWrap(cell, field, point, row) = 0.0;
891 for(
size_t col = 0; col < matDim; col++){
892 outputFieldsWrap(cell, field, point, row) += \
893 inputDataWrap(cell, 0, row, col)*inputFieldsWrap(cell, field, point, col);
900 else if ((transpose ==
't') || (transpose ==
'T')) {
901 for(
size_t cell = 0; cell < numCells; cell++){
902 for(
size_t field = 0; field < numFields; field++){
903 for(
size_t point = 0; point < numPoints; point++){
904 for(
size_t row = 0; row < matDim; row++){
905 outputFieldsWrap(cell, field, point, row) = 0.0;
906 for(
size_t col = 0; col < matDim; col++){
907 outputFieldsWrap(cell, field, point, row) += \
908 inputDataWrap(cell, 0, col, row)*inputFieldsWrap(cell, field, point, col);
916 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
917 ">>> ERROR (ArrayTools::matvecProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
922 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
923 ">>> ERROR (ArrayTools::matvecProductDataField): inputData rank 2, 3 or 4 required.")
930 else if(inRank == 3) {
935 for(
size_t cell = 0; cell < numCells; cell++) {
936 for(
size_t field = 0; field < numFields; field++) {
937 for(
size_t point = 0; point < numPoints; point++) {
938 for(
size_t row = 0; row < matDim; row++) {
939 outputFieldsWrap(cell, field, point, row) = \
940 inputDataWrap(cell, point)*inputFieldsWrap(field, point, row);
948 for(
size_t cell = 0; cell < numCells; cell++) {
949 for(
size_t field = 0; field < numFields; field++) {
950 for(
size_t point = 0; point < numPoints; point++) {
951 for(
size_t row = 0; row < matDim; row++) {
952 outputFieldsWrap(cell, field, point, row) = \
953 inputDataWrap(cell, point, row)*inputFieldsWrap(field, point, row);
961 if ((transpose ==
'n') || (transpose ==
'N')) {
962 for(
size_t cell = 0; cell < numCells; cell++){
963 for(
size_t field = 0; field < numFields; field++){
964 for(
size_t point = 0; point < numPoints; point++){
965 for(
size_t row = 0; row < matDim; row++){
966 outputFieldsWrap(cell, field, point, row) = 0.0;
967 for(
size_t col = 0; col < matDim; col++){
968 outputFieldsWrap(cell, field, point, row) += \
969 inputDataWrap(cell, point, row, col)*inputFieldsWrap(field, point, col);
976 else if ((transpose ==
't') || (transpose ==
'T')) {
977 for(
size_t cell = 0; cell < numCells; cell++){
978 for(
size_t field = 0; field < numFields; field++){
979 for(
size_t point = 0; point < numPoints; point++){
980 for(
size_t row = 0; row < matDim; row++){
981 outputFieldsWrap(cell, field, point, row) = 0.0;
982 for(
size_t col = 0; col < matDim; col++){
983 outputFieldsWrap(cell, field, point, row) += \
984 inputDataWrap(cell, point, col, row)*inputFieldsWrap(field, point, col);
992 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
993 ">>> ERROR (ArrayTools::matvecProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
998 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
999 ">>> ERROR (ArrayTools::matvecProductDataField): inputData rank 2, 3 or 4 required.")
1005 for(
size_t cell = 0; cell < numCells; cell++) {
1006 for(
size_t field = 0; field < numFields; field++) {
1007 for(
size_t point = 0; point < numPoints; point++) {
1008 for(
size_t row = 0; row < matDim; row++) {
1009 outputFieldsWrap(cell, field, point, row) = \
1010 inputDataWrap(cell, 0)*inputFieldsWrap(field, point, row);
1018 for(
size_t cell = 0; cell < numCells; cell++) {
1019 for(
size_t field = 0; field < numFields; field++) {
1020 for(
size_t point = 0; point < numPoints; point++) {
1021 for(
size_t row = 0; row < matDim; row++) {
1022 outputFieldsWrap(cell, field, point, row) = \
1023 inputDataWrap(cell, 0, row)*inputFieldsWrap(field, point, row);
1031 if ((transpose ==
'n') || (transpose ==
'N')) {
1032 for(
size_t cell = 0; cell < numCells; cell++){
1033 for(
size_t field = 0; field < numFields; field++){
1034 for(
size_t point = 0; point < numPoints; point++){
1035 for(
size_t row = 0; row < matDim; row++){
1036 outputFieldsWrap(cell, field, point, row) = 0.0;
1037 for(
size_t col = 0; col < matDim; col++){
1038 outputFieldsWrap(cell, field, point, row) += \
1039 inputDataWrap(cell, 0, row, col)*inputFieldsWrap(field, point, col);
1046 else if ((transpose ==
't') || (transpose ==
'T')) {
1047 for(
size_t cell = 0; cell < numCells; cell++){
1048 for(
size_t field = 0; field < numFields; field++){
1049 for(
size_t point = 0; point < numPoints; point++){
1050 for(
size_t row = 0; row < matDim; row++){
1051 outputFieldsWrap(cell, field, point, row) = 0.0;
1052 for(
size_t col = 0; col < matDim; col++){
1053 outputFieldsWrap(cell, field, point, row) += \
1054 inputDataWrap(cell, 0, col, row)*inputFieldsWrap(field, point, col);
1062 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1063 ">>> ERROR (ArrayTools::matvecProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
1068 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
1069 ">>> ERROR (ArrayTools::matvecProductDataField): inputData rank 2, 3 or 4 required.")
1074 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
1075 ">>> ERROR (ArrayTools::matvecProductDataField): inputFields rank 3 or 4 required.")
1081 template<
class Scalar,
1083 class ArrayInDataLeft,
1084 class ArrayInDataRight>
1086 const ArrayInDataLeft & inputDataLeft,
1087 const ArrayInDataRight & inputDataRight,
1088 const char transpose){
1090 #ifdef HAVE_INTREPID_DEBUG
1091 std::string errmsg =
">>> ERROR (ArrayTools::matvecProductDataData):";
1099 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataLeft, 2,4),
1100 std::invalid_argument, errmsg);
1101 if(getrank(inputDataLeft) > 2) {
1102 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 2, 1,3),
1103 std::invalid_argument, errmsg);
1105 if(getrank(inputDataLeft) == 4) {
1106 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 3, 1,3),
1107 std::invalid_argument, errmsg);
1110 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataRight, 2,3),
1111 std::invalid_argument, errmsg);
1112 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataRight, getrank(inputDataRight)-1, 1,3),
1113 std::invalid_argument, errmsg);
1115 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputData, 3,3), std::invalid_argument, errmsg);
1116 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputData, 2, 1,3),
1117 std::invalid_argument, errmsg);
1129 if(inputDataLeft.dimension(1) > 1){
1130 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1133 std::invalid_argument, errmsg);
1135 if(getrank(inputDataLeft) == 2){
1136 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1139 std::invalid_argument, errmsg);
1141 if(getrank(inputDataLeft) == 3){
1142 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1144 inputDataLeft, 0,2),
1145 std::invalid_argument, errmsg);
1147 if(getrank(inputDataLeft) == 4){
1148 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1150 inputDataLeft, 0,2,3),
1151 std::invalid_argument, errmsg);
1156 if( getrank(inputDataRight) == 3) {
1158 if(inputDataLeft.dimension(1) > 1){
1159 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1162 std::invalid_argument, errmsg);
1164 if(getrank(inputDataLeft) == 2){
1165 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1168 std::invalid_argument, errmsg);
1170 if(getrank(inputDataLeft) == 3){
1171 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1173 inputDataRight, 0,2),
1174 std::invalid_argument, errmsg);
1176 if(getrank(inputDataLeft) == 4){
1177 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1178 inputDataLeft, 0,2,3,
1179 inputDataRight, 0,2,2),
1180 std::invalid_argument, errmsg);
1184 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, inputDataRight),
1185 std::invalid_argument, errmsg);
1189 if(inputDataLeft.dimension(1) > 1){
1190 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1193 std::invalid_argument, errmsg);
1195 if(getrank(inputDataLeft) == 3){
1196 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1199 std::invalid_argument, errmsg);
1201 if(getrank(inputDataLeft) == 4){
1202 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1204 inputDataRight, 1,1),
1205 std::invalid_argument, errmsg);
1208 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1210 inputDataRight, 0,1),
1211 std::invalid_argument, errmsg);
1218 size_t dataLeftRank = getrank(inputDataLeft);
1219 size_t numDataLeftPts = inputDataLeft.dimension(1);
1220 size_t dataRightRank = getrank(inputDataRight);
1221 size_t numCells = outputData.dimension(0);
1222 size_t numPoints = outputData.dimension(1);
1223 size_t matDim = outputData.dimension(2);
1228 if(dataRightRank == 3){
1229 if(numDataLeftPts != 1){
1231 switch(dataLeftRank){
1233 for(
size_t cell = 0; cell < numCells; cell++) {
1234 for(
size_t point = 0; point < numPoints; point++) {
1235 for(
size_t row = 0; row < matDim; row++) {
1236 outputDataWrap(cell, point, row) = \
1237 inputDataLeftWrap(cell, point)*inputDataRightWrap(cell, point, row);
1244 for(
size_t cell = 0; cell < numCells; cell++) {
1245 for(
size_t point = 0; point < numPoints; point++) {
1246 for(
size_t row = 0; row < matDim; row++) {
1247 outputDataWrap(cell, point, row) = \
1248 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(cell, point, row);
1255 if ((transpose ==
'n') || (transpose ==
'N')) {
1256 for(
size_t cell = 0; cell < numCells; cell++){
1257 for(
size_t point = 0; point < numPoints; point++){
1258 for(
size_t row = 0; row < matDim; row++){
1259 outputDataWrap(cell, point, row) = 0.0;
1260 for(
size_t col = 0; col < matDim; col++){
1261 outputDataWrap(cell, point, row) += \
1262 inputDataLeftWrap(cell, point, row, col)*inputDataRightWrap(cell, point, col);
1268 else if ((transpose ==
't') || (transpose ==
'T')) {
1269 for(
size_t cell = 0; cell < numCells; cell++){
1270 for(
size_t point = 0; point < numPoints; point++){
1271 for(
size_t row = 0; row < matDim; row++){
1272 outputDataWrap(cell, point, row) = 0.0;
1273 for(
size_t col = 0; col < matDim; col++){
1274 outputDataWrap(cell, point, row) += \
1275 inputDataLeftWrap(cell, point, col, row)*inputDataRightWrap(cell, point, col);
1282 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1283 ">>> ERROR (ArrayTools::matvecProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
1288 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
1289 ">>> ERROR (ArrayTools::matvecProductDataData): inputDataLeft rank 2, 3 or 4 required.")
1293 switch(dataLeftRank){
1295 for(
size_t cell = 0; cell < numCells; cell++) {
1296 for(
size_t point = 0; point < numPoints; point++) {
1297 for(
size_t row = 0; row < matDim; row++) {
1298 outputDataWrap(cell, point, row) = \
1299 inputDataLeftWrap(cell, 0)*inputDataRightWrap(cell, point, row);
1306 for(
size_t cell = 0; cell < numCells; cell++) {
1307 for(
size_t point = 0; point < numPoints; point++) {
1308 for(
size_t row = 0; row < matDim; row++) {
1309 outputDataWrap(cell, point, row) = \
1310 inputDataLeftWrap(cell, 0, row)*inputDataRightWrap(cell, point, row);
1317 if ((transpose ==
'n') || (transpose ==
'N')) {
1318 for(
size_t cell = 0; cell < numCells; cell++){
1319 for(
size_t point = 0; point < numPoints; point++){
1320 for(
size_t row = 0; row < matDim; row++){
1321 outputDataWrap(cell, point, row) = 0.0;
1322 for(
size_t col = 0; col < matDim; col++){
1323 outputDataWrap(cell, point, row) += \
1324 inputDataLeftWrap(cell, 0, row, col)*inputDataRightWrap(cell, point, col);
1330 else if ((transpose ==
't') || (transpose ==
'T')) {
1331 for(
size_t cell = 0; cell < numCells; cell++){
1332 for(
size_t point = 0; point < numPoints; point++){
1333 for(
size_t row = 0; row < matDim; row++){
1334 outputDataWrap(cell, point, row) = 0.0;
1335 for(
size_t col = 0; col < matDim; col++){
1336 outputDataWrap(cell, point, row) += \
1337 inputDataLeftWrap(cell, 0, col, row)*inputDataRightWrap(cell, point, col);
1344 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1345 ">>> ERROR (ArrayTools::matvecProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
1350 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
1351 ">>> ERROR (ArrayTools::matvecProductDataData): inputDataLeft rank 2, 3 or 4 required.")
1358 else if(dataRightRank == 2) {
1359 if(numDataLeftPts != 1){
1361 switch(dataLeftRank){
1363 for(
size_t cell = 0; cell < numCells; cell++) {
1364 for(
size_t point = 0; point < numPoints; point++) {
1365 for(
size_t row = 0; row < matDim; row++) {
1366 outputDataWrap(cell, point, row) = \
1367 inputDataLeftWrap(cell, point)*inputDataRightWrap(point, row);
1374 for(
size_t cell = 0; cell < numCells; cell++) {
1375 for(
size_t point = 0; point < numPoints; point++) {
1376 for(
size_t row = 0; row < matDim; row++) {
1377 outputDataWrap(cell, point, row) = \
1378 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(point, row);
1385 if ((transpose ==
'n') || (transpose ==
'N')) {
1386 for(
size_t cell = 0; cell < numCells; cell++){
1387 for(
size_t point = 0; point < numPoints; point++){
1388 for(
size_t row = 0; row < matDim; row++){
1389 outputDataWrap(cell, point, row) = 0.0;
1390 for(
size_t col = 0; col < matDim; col++){
1391 outputDataWrap(cell, point, row) += \
1392 inputDataLeftWrap(cell, point, row, col)*inputDataRightWrap(point, col);
1398 else if ((transpose ==
't') || (transpose ==
'T')) {
1399 for(
size_t cell = 0; cell < numCells; cell++){
1400 for(
size_t point = 0; point < numPoints; point++){
1401 for(
size_t row = 0; row < matDim; row++){
1402 outputDataWrap(cell, point, row) = 0.0;
1403 for(
size_t col = 0; col < matDim; col++){
1404 outputDataWrap(cell, point, row) += \
1405 inputDataLeftWrap(cell, point, col, row)*inputDataRightWrap(point, col);
1412 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1413 ">>> ERROR (ArrayTools::matvecProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
1418 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
1419 ">>> ERROR (ArrayTools::matvecProductDataData): inputDataLeft rank 2, 3 or 4 required.")
1423 switch(dataLeftRank){
1425 for(
size_t cell = 0; cell < numCells; cell++) {
1426 for(
size_t point = 0; point < numPoints; point++) {
1427 for(
size_t row = 0; row < matDim; row++) {
1428 outputDataWrap(cell, point, row) = \
1429 inputDataLeftWrap(cell, 0)*inputDataRightWrap(point, row);
1436 for(
size_t cell = 0; cell < numCells; cell++) {
1437 for(
size_t point = 0; point < numPoints; point++) {
1438 for(
size_t row = 0; row < matDim; row++) {
1439 outputDataWrap(cell, point, row) = \
1440 inputDataLeftWrap(cell, 0, row)*inputDataRightWrap(point, row);
1447 if ((transpose ==
'n') || (transpose ==
'N')) {
1448 for(
size_t cell = 0; cell < numCells; cell++){
1449 for(
size_t point = 0; point < numPoints; point++){
1450 for(
size_t row = 0; row < matDim; row++){
1451 outputDataWrap(cell, point, row) = 0.0;
1452 for(
size_t col = 0; col < matDim; col++){
1453 outputDataWrap(cell, point, row) += \
1454 inputDataLeftWrap(cell, 0, row, col)*inputDataRightWrap(point, col);
1460 else if ((transpose ==
't') || (transpose ==
'T')) {
1461 for(
size_t cell = 0; cell < numCells; cell++){
1462 for(
size_t point = 0; point < numPoints; point++){
1463 for(
size_t row = 0; row < matDim; row++){
1464 outputDataWrap(cell, point, row) = 0.0;
1465 for(
size_t col = 0; col < matDim; col++){
1466 outputDataWrap(cell, point, row) += \
1467 inputDataLeftWrap(cell, 0, col, row)*inputDataRightWrap(point, col);
1474 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1475 ">>> ERROR (ArrayTools::matvecProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
1480 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
1481 ">>> ERROR (ArrayTools::matvecProductDataData): inputDataLeft rank 2, 3 or 4 required.")
1486 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
1487 ">>> ERROR (ArrayTools::matvecProductDataData): inputDataRight rank 2 or 3 required.")
1493 template<
class Scalar,
1494 class ArrayOutFields,
1496 class ArrayInFields>
1498 const ArrayInData & inputData,
1499 const ArrayInFields & inputFields,
1500 const char transpose){
1501 #ifdef HAVE_INTREPID_DEBUG
1502 std::string errmsg =
">>> ERROR (ArrayTools::matmatProductDataField):";
1510 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputData, 2,4),
1511 std::invalid_argument, errmsg);
1512 if(getrank(inputData) > 2) {
1513 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 2, 1,3),
1514 std::invalid_argument, errmsg);
1516 if(getrank(inputData) == 4) {
1517 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputData, 3, 1,3),
1518 std::invalid_argument, errmsg);
1521 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputFields, 4,5), std::invalid_argument, errmsg);
1522 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputFields, getrank(inputFields)-1, 1,3),
1523 std::invalid_argument, errmsg);
1524 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputFields, getrank(inputFields)-2, 1,3),
1525 std::invalid_argument, errmsg);
1527 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputFields, 5,5), std::invalid_argument, errmsg);
1528 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputFields, 3, 1,3),
1529 std::invalid_argument, errmsg);
1530 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputFields, 4, 1,3),
1531 std::invalid_argument, errmsg);
1543 if(inputData.dimension(1) > 1){
1544 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1547 std::invalid_argument, errmsg);
1549 if(getrank(inputData) == 2) {
1550 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1553 std::invalid_argument, errmsg);
1555 if(getrank(inputData) == 3){
1556 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1557 outputFields, 0,3,4,
1559 std::invalid_argument, errmsg);
1562 if(getrank(inputData) == 4){
1563 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1564 outputFields, 0,3,4,
1566 std::invalid_argument, errmsg);
1571 if( getrank(inputFields) == 5) {
1573 if(inputData.dimension(1) > 1){
1574 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1577 std::invalid_argument, errmsg);
1579 if(getrank(inputData) == 2){
1580 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1583 std::invalid_argument, errmsg);
1585 if(getrank(inputData) == 3){
1586 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1588 inputFields, 0,3,4),
1589 std::invalid_argument, errmsg);
1591 if(getrank(inputData) == 4){
1592 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1594 inputFields, 0,3,4),
1595 std::invalid_argument, errmsg);
1598 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputFields, inputFields),
1599 std::invalid_argument, errmsg);
1603 if(inputData.dimension(1) > 1){
1604 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1607 std::invalid_argument, errmsg);
1609 if(getrank(inputData) == 3){
1610 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1613 std::invalid_argument, errmsg);
1615 if(getrank(inputData) == 4){
1616 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1619 std::invalid_argument, errmsg);
1622 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
1623 outputFields, 1,2,3,4,
1624 inputFields, 0,1,2,3),
1625 std::invalid_argument, errmsg);
1633 size_t dataRank = getrank(inputData);
1634 size_t numDataPts = inputData.dimension(1);
1635 size_t inRank = getrank(inputFields);
1636 size_t numCells = outputFields.dimension(0);
1637 size_t numFields = outputFields.dimension(1);
1638 size_t numPoints = outputFields.dimension(2);
1639 size_t matDim = outputFields.dimension(3);
1645 if(numDataPts != 1){
1649 for(
size_t cell = 0; cell < numCells; cell++) {
1650 for(
size_t field = 0; field < numFields; field++) {
1651 for(
size_t point = 0; point < numPoints; point++) {
1652 for(
size_t row = 0; row < matDim; row++) {
1653 for(
size_t col = 0; col < matDim; col++) {
1654 outputFieldsWrap(cell, field, point, row, col) = \
1655 inputDataWrap(cell, point)*inputFieldsWrap(cell, field, point, row, col);
1664 for(
size_t cell = 0; cell < numCells; cell++) {
1665 for(
size_t field = 0; field < numFields; field++) {
1666 for(
size_t point = 0; point < numPoints; point++) {
1667 for(
size_t row = 0; row < matDim; row++) {
1668 for(
size_t col = 0; col < matDim; col++) {
1669 outputFieldsWrap(cell, field, point, row, col) = \
1670 inputDataWrap(cell, point, row)*inputFieldsWrap(cell, field, point, row, col);
1679 if ((transpose ==
'n') || (transpose ==
'N')) {
1680 for(
size_t cell = 0; cell < numCells; cell++){
1681 for(
size_t field = 0; field < numFields; field++){
1682 for(
size_t point = 0; point < numPoints; point++){
1683 for(
size_t row = 0; row < matDim; row++){
1684 for(
size_t col = 0; col < matDim; col++){
1685 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1686 for(
size_t i = 0; i < matDim; i++){
1687 outputFieldsWrap(cell, field, point, row, col) += \
1688 inputDataWrap(cell, point, row, i)*inputFieldsWrap(cell, field, point, i, col);
1696 else if ((transpose ==
't') || (transpose ==
'T')) {
1697 for(
size_t cell = 0; cell < numCells; cell++){
1698 for(
size_t field = 0; field < numFields; field++){
1699 for(
size_t point = 0; point < numPoints; point++){
1700 for(
size_t row = 0; row < matDim; row++){
1701 for(
size_t col = 0; col < matDim; col++){
1702 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1703 for(
size_t i = 0; i < matDim; i++){
1704 outputFieldsWrap(cell, field, point, row, col) += \
1705 inputDataWrap(cell, point, i, row)*inputFieldsWrap(cell, field, point, i, col);
1714 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1715 ">>> ERROR (ArrayTools::matmatProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
1720 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
1721 ">>> ERROR (ArrayTools::matmatProductDataField): inputData rank 2, 3 or 4 required.")
1727 for(
size_t cell = 0; cell < numCells; cell++) {
1728 for(
size_t field = 0; field < numFields; field++) {
1729 for(
size_t point = 0; point < numPoints; point++) {
1730 for(
size_t row = 0; row < matDim; row++) {
1731 for(
size_t col = 0; col < matDim; col++) {
1732 outputFieldsWrap(cell, field, point, row, col) = \
1733 inputDataWrap(cell, 0)*inputFieldsWrap(cell, field, point, row, col);
1742 for(
size_t cell = 0; cell < numCells; cell++) {
1743 for(
size_t field = 0; field < numFields; field++) {
1744 for(
size_t point = 0; point < numPoints; point++) {
1745 for(
size_t row = 0; row < matDim; row++) {
1746 for(
size_t col = 0; col < matDim; col++) {
1747 outputFieldsWrap(cell, field, point, row, col) = \
1748 inputDataWrap(cell, 0, row)*inputFieldsWrap(cell, field, point, row, col);
1757 if ((transpose ==
'n') || (transpose ==
'N')) {
1758 for(
size_t cell = 0; cell < numCells; cell++){
1759 for(
size_t field = 0; field < numFields; field++){
1760 for(
size_t point = 0; point < numPoints; point++){
1761 for(
size_t row = 0; row < matDim; row++){
1762 for(
size_t col = 0; col < matDim; col++){
1763 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1764 for(
size_t i = 0; i < matDim; i++){
1765 outputFieldsWrap(cell, field, point, row, col) += \
1766 inputDataWrap(cell, 0, row, i)*inputFieldsWrap(cell, field, point, i, col);
1774 else if ((transpose ==
't') || (transpose ==
'T')) {
1775 for(
size_t cell = 0; cell < numCells; cell++){
1776 for(
size_t field = 0; field < numFields; field++){
1777 for(
size_t point = 0; point < numPoints; point++){
1778 for(
size_t row = 0; row < matDim; row++){
1779 for(
size_t col = 0; col < matDim; col++){
1780 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1781 for(
size_t i = 0; i < matDim; i++){
1782 outputFieldsWrap(cell, field, point, row, col) += \
1783 inputDataWrap(cell, 0, i, row)*inputFieldsWrap(cell, field, point, i, col);
1792 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1793 ">>> ERROR (ArrayTools::matmatProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
1798 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
1799 ">>> ERROR (ArrayTools::matmatProductDataField): inputData rank 2, 3 or 4 required.")
1806 else if(inRank == 4) {
1807 if(numDataPts != 1){
1811 for(
size_t cell = 0; cell < numCells; cell++) {
1812 for(
size_t field = 0; field < numFields; field++) {
1813 for(
size_t point = 0; point < numPoints; point++) {
1814 for(
size_t row = 0; row < matDim; row++) {
1815 for(
size_t col = 0; col < matDim; col++) {
1816 outputFieldsWrap(cell, field, point, row, col) = \
1817 inputDataWrap(cell, point)*inputFieldsWrap(field, point, row, col);
1826 for(
size_t cell = 0; cell < numCells; cell++) {
1827 for(
size_t field = 0; field < numFields; field++) {
1828 for(
size_t point = 0; point < numPoints; point++) {
1829 for(
size_t row = 0; row < matDim; row++) {
1830 for(
size_t col = 0; col < matDim; col++) {
1831 outputFieldsWrap(cell, field, point, row, col) = \
1832 inputDataWrap(cell, point, row)*inputFieldsWrap(field, point, row, col);
1841 if ((transpose ==
'n') || (transpose ==
'N')) {
1842 for(
size_t cell = 0; cell < numCells; cell++){
1843 for(
size_t field = 0; field < numFields; field++){
1844 for(
size_t point = 0; point < numPoints; point++){
1845 for(
size_t row = 0; row < matDim; row++){
1846 for(
size_t col = 0; col < matDim; col++){
1847 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1848 for(
size_t i = 0; i < matDim; i++){
1849 outputFieldsWrap(cell, field, point, row, col) += \
1850 inputDataWrap(cell, point, row, i)*inputFieldsWrap(field, point, i, col);
1858 else if ((transpose ==
't') || (transpose ==
'T')) {
1859 for(
size_t cell = 0; cell < numCells; cell++){
1860 for(
size_t field = 0; field < numFields; field++){
1861 for(
size_t point = 0; point < numPoints; point++){
1862 for(
size_t row = 0; row < matDim; row++){
1863 for(
size_t col = 0; col < matDim; col++){
1864 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1865 for(
size_t i = 0; i < matDim; i++){
1866 outputFieldsWrap(cell, field, point, row, col) += \
1867 inputDataWrap(cell, point, i, row)*inputFieldsWrap(field, point, i, col);
1876 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1877 ">>> ERROR (ArrayTools::matmatProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
1882 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
1883 ">>> ERROR (ArrayTools::matmatProductDataField): inputData rank 2, 3 or 4 required.")
1889 for(
size_t cell = 0; cell < numCells; cell++) {
1890 for(
size_t field = 0; field < numFields; field++) {
1891 for(
size_t point = 0; point < numPoints; point++) {
1892 for(
size_t row = 0; row < matDim; row++) {
1893 for(
size_t col = 0; col < matDim; col++) {
1894 outputFieldsWrap(cell, field, point, row, col) = \
1895 inputDataWrap(cell, 0)*inputFieldsWrap(field, point, row, col);
1904 for(
size_t cell = 0; cell < numCells; cell++) {
1905 for(
size_t field = 0; field < numFields; field++) {
1906 for(
size_t point = 0; point < numPoints; point++) {
1907 for(
size_t row = 0; row < matDim; row++) {
1908 for(
size_t col = 0; col < matDim; col++) {
1909 outputFieldsWrap(cell, field, point, row, col) = \
1910 inputDataWrap(cell, 0, row)*inputFieldsWrap(field, point, row, col);
1919 if ((transpose ==
'n') || (transpose ==
'N')) {
1920 for(
size_t cell = 0; cell < numCells; cell++){
1921 for(
size_t field = 0; field < numFields; field++){
1922 for(
size_t point = 0; point < numPoints; point++){
1923 for(
size_t row = 0; row < matDim; row++){
1924 for(
size_t col = 0; col < matDim; col++){
1925 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1926 for(
size_t i = 0; i < matDim; i++){
1927 outputFieldsWrap(cell, field, point, row, col) += \
1928 inputDataWrap(cell, 0, row, i)*inputFieldsWrap(field, point, i, col);
1936 else if ((transpose ==
't') || (transpose ==
'T')) {
1937 for(
size_t cell = 0; cell < numCells; cell++){
1938 for(
size_t field = 0; field < numFields; field++){
1939 for(
size_t point = 0; point < numPoints; point++){
1940 for(
size_t row = 0; row < matDim; row++){
1941 for(
size_t col = 0; col < matDim; col++){
1942 outputFieldsWrap(cell, field, point, row, col) = 0.0;
1943 for(
size_t i = 0; i < matDim; i++){
1944 outputFieldsWrap(cell, field, point, row, col) += \
1945 inputDataWrap(cell, 0, i, row)*inputFieldsWrap(field, point, i, col);
1954 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
1955 ">>> ERROR (ArrayTools::matmatProductDataField): The transpose flag must be 'n', 'N', 't' or 'T'.");
1960 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataRank == 2) || (dataRank == 3) || (dataRank == 4) ), std::invalid_argument,
1961 ">>> ERROR (ArrayTools::matmatProductDataField): inputData rank 2, 3 or 4 required.")
1966 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
1967 ">>> ERROR (ArrayTools::matmatProductDataField): inputFields rank 4 or 5 required.")
1972 template<
class Scalar,
1974 class ArrayInDataLeft,
1975 class ArrayInDataRight>
1977 const ArrayInDataLeft & inputDataLeft,
1978 const ArrayInDataRight & inputDataRight,
1979 const char transpose){
1981 #ifdef HAVE_INTREPID_DEBUG
1982 std::string errmsg =
">>> ERROR (ArrayTools::matmatProductDataData):";
1990 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataLeft, 2,4),
1991 std::invalid_argument, errmsg);
1992 if(getrank(inputDataLeft) > 2) {
1993 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 2, 1,3),
1994 std::invalid_argument, errmsg);
1996 if(getrank(inputDataLeft) == 4) {
1997 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataLeft, 3, 1,3),
1998 std::invalid_argument, errmsg);
2001 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, inputDataRight, 3,4),
2002 std::invalid_argument, errmsg);
2003 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataRight, getrank(inputDataRight)-1, 1,3),
2004 std::invalid_argument, errmsg);
2005 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, inputDataRight, getrank(inputDataRight)-2, 1,3),
2006 std::invalid_argument, errmsg);
2008 TEUCHOS_TEST_FOR_EXCEPTION( !requireRankRange(errmsg, outputData, 4, 4), std::invalid_argument, errmsg);
2009 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputData, 2, 1,3),
2010 std::invalid_argument, errmsg);
2011 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionRange(errmsg, outputData, 3, 1,3),
2012 std::invalid_argument, errmsg);
2024 if(inputDataLeft.dimension(1) > 1){
2025 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2028 std::invalid_argument, errmsg);
2030 if(getrank(inputDataLeft) == 2){
2031 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2034 std::invalid_argument, errmsg);
2036 if(getrank(inputDataLeft) == 3){
2037 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2039 inputDataLeft, 0,2,2),
2040 std::invalid_argument, errmsg);
2042 if(getrank(inputDataLeft) == 4){
2043 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2045 inputDataLeft, 0,2,3),
2046 std::invalid_argument, errmsg);
2051 if( getrank(inputDataRight) == 4) {
2053 if(inputDataLeft.dimension(1) > 1){
2054 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2057 std::invalid_argument, errmsg);
2059 if(getrank(inputDataLeft) == 2){
2060 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2063 std::invalid_argument, errmsg);
2065 if(getrank(inputDataLeft) == 3){
2066 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2067 inputDataLeft, 0,2,2,
2068 inputDataRight, 0,2,3),
2069 std::invalid_argument, errmsg);
2071 if(getrank(inputDataLeft) == 4){
2072 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2073 inputDataLeft, 0,2,3,
2074 inputDataRight, 0,2,3),
2075 std::invalid_argument, errmsg);
2078 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg, outputData, inputDataRight),
2079 std::invalid_argument, errmsg);
2083 if(inputDataLeft.dimension(1) > 1){
2084 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2087 std::invalid_argument, errmsg);
2089 if(getrank(inputDataLeft) == 3){
2090 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2092 inputDataRight, 1,2),
2093 std::invalid_argument, errmsg);
2095 if(getrank(inputDataLeft) == 4){
2096 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2098 inputDataRight, 1,2),
2099 std::invalid_argument, errmsg);
2102 TEUCHOS_TEST_FOR_EXCEPTION( !requireDimensionMatch(errmsg,
2104 inputDataRight, 0,1,2),
2105 std::invalid_argument, errmsg);
2114 size_t dataLeftRank = getrank(inputDataLeft);
2115 size_t numDataLeftPts = inputDataLeft.dimension(1);
2116 size_t dataRightRank = getrank(inputDataRight);
2117 size_t numCells = outputData.dimension(0);
2118 size_t numPoints = outputData.dimension(1);
2119 size_t matDim = outputData.dimension(2);
2124 if(dataRightRank == 4){
2125 if(numDataLeftPts != 1){
2127 switch(dataLeftRank){
2129 for(
size_t cell = 0; cell < numCells; cell++) {
2130 for(
size_t point = 0; point < numPoints; point++) {
2131 for(
size_t row = 0; row < matDim; row++) {
2132 for(
size_t col = 0; col < matDim; col++) {
2133 outputDataWrap(cell, point, row, col) = \
2134 inputDataLeftWrap(cell, point)*inputDataRightWrap(cell, point, row, col);
2142 for(
size_t cell = 0; cell < numCells; cell++) {
2143 for(
size_t point = 0; point < numPoints; point++) {
2144 for(
size_t row = 0; row < matDim; row++) {
2145 for(
size_t col = 0; col < matDim; col++) {
2146 outputDataWrap(cell, point, row, col) = \
2147 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(cell, point, row, col);
2155 if ((transpose ==
'n') || (transpose ==
'N')) {
2156 for(
size_t cell = 0; cell < numCells; cell++){
2157 for(
size_t point = 0; point < numPoints; point++){
2158 for(
size_t row = 0; row < matDim; row++){
2159 for(
size_t col = 0; col < matDim; col++){
2160 outputDataWrap(cell, point, row, col) = 0.0;
2161 for(
size_t i = 0; i < matDim; i++){
2162 outputDataWrap(cell, point, row, col) += \
2163 inputDataLeftWrap(cell, point, row, i)*inputDataRightWrap(cell, point, i, col);
2170 else if ((transpose ==
't') || (transpose ==
'T')) {
2171 for(
size_t cell = 0; cell < numCells; cell++){
2172 for(
size_t point = 0; point < numPoints; point++){
2173 for(
size_t row = 0; row < matDim; row++){
2174 for(
size_t col = 0; col < matDim; col++){
2175 outputDataWrap(cell, point, row, col) = 0.0;
2176 for(
size_t i = 0; i < matDim; i++){
2177 outputDataWrap(cell, point, row, col) += \
2178 inputDataLeftWrap(cell, point, i, row)*inputDataRightWrap(cell, point, i, col);
2186 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
2187 ">>> ERROR (ArrayTools::matmatProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
2192 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
2193 ">>> ERROR (ArrayTools::matmatProductDataData): inputDataLeft rank 2, 3 or 4 required.")
2197 switch(dataLeftRank){
2199 for(
size_t cell = 0; cell < numCells; cell++) {
2200 for(
size_t point = 0; point < numPoints; point++) {
2201 for(
size_t row = 0; row < matDim; row++) {
2202 for(
size_t col = 0; col < matDim; col++) {
2203 outputDataWrap(cell, point, row, col) = \
2204 inputDataLeftWrap(cell, 0)*inputDataRightWrap(cell, point, row, col);
2212 for(
size_t cell = 0; cell < numCells; cell++) {
2213 for(
size_t point = 0; point < numPoints; point++) {
2214 for(
size_t row = 0; row < matDim; row++) {
2215 for(
size_t col = 0; col < matDim; col++) {
2216 outputDataWrap(cell, point, row, col) = \
2217 inputDataLeftWrap(cell, 0, row)*inputDataRightWrap(cell, point, row, col);
2225 if ((transpose ==
'n') || (transpose ==
'N')) {
2226 for(
size_t cell = 0; cell < numCells; cell++){
2227 for(
size_t point = 0; point < numPoints; point++){
2228 for(
size_t row = 0; row < matDim; row++){
2229 for(
size_t col = 0; col < matDim; col++){
2230 outputDataWrap(cell, point, row, col) = 0.0;
2231 for(
size_t i = 0; i < matDim; i++){
2232 outputDataWrap(cell, point, row, col) += \
2233 inputDataLeftWrap(cell, 0, row, i)*inputDataRightWrap(cell, point, i, col);
2240 else if ((transpose ==
't') || (transpose ==
'T')) {
2241 for(
size_t cell = 0; cell < numCells; cell++){
2242 for(
size_t point = 0; point < numPoints; point++){
2243 for(
size_t row = 0; row < matDim; row++){
2244 for(
size_t col = 0; col < matDim; col++){
2245 outputDataWrap(cell, point, row, col) = 0.0;
2246 for(
size_t i = 0; i < matDim; i++){
2247 outputDataWrap(cell, point, row, col) += \
2248 inputDataLeftWrap(cell, 0, i, row)*inputDataRightWrap(cell, point, i, col);
2256 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
2257 ">>> ERROR (ArrayTools::matmatProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
2262 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
2263 ">>> ERROR (ArrayTools::matmatProductDataData): inputDataLeft rank 2, 3 or 4 required.")
2270 else if(dataRightRank == 3) {
2271 if(numDataLeftPts != 1){
2273 switch(dataLeftRank){
2275 for(
size_t cell = 0; cell < numCells; cell++) {
2276 for(
size_t point = 0; point < numPoints; point++) {
2277 for(
size_t row = 0; row < matDim; row++) {
2278 for(
size_t col = 0; col < matDim; col++) {
2279 outputDataWrap(cell, point, row, col) = \
2280 inputDataLeftWrap(cell, point)*inputDataRightWrap(point, row, col);
2288 for(
size_t cell = 0; cell < numCells; cell++) {
2289 for(
size_t point = 0; point < numPoints; point++) {
2290 for(
size_t row = 0; row < matDim; row++) {
2291 for(
size_t col = 0; col < matDim; col++) {
2292 outputDataWrap(cell, point, row, col) = \
2293 inputDataLeftWrap(cell, point, row)*inputDataRightWrap(point, row, col);
2301 if ((transpose ==
'n') || (transpose ==
'N')) {
2302 for(
size_t cell = 0; cell < numCells; cell++){
2303 for(
size_t point = 0; point < numPoints; point++){
2304 for(
size_t row = 0; row < matDim; row++){
2305 for(
size_t col = 0; col < matDim; col++){
2306 outputDataWrap(cell, point, row, col) = 0.0;
2307 for(
size_t i = 0; i < matDim; i++){
2308 outputDataWrap(cell, point, row, col) += \
2309 inputDataLeftWrap(cell, point, row, i)*inputDataRightWrap(point, i, col);
2316 else if ((transpose ==
't') || (transpose ==
'T')) {
2317 for(
size_t cell = 0; cell < numCells; cell++){
2318 for(
size_t point = 0; point < numPoints; point++){
2319 for(
size_t row = 0; row < matDim; row++){
2320 for(
size_t col = 0; col < matDim; col++){
2321 outputDataWrap(cell, point, row, col) = 0.0;
2322 for(
size_t i = 0; i < matDim; i++){
2323 outputDataWrap(cell, point, row, col) += \
2324 inputDataLeftWrap(cell, point, i, row)*inputDataRightWrap(point, i, col);
2332 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
2333 ">>> ERROR (ArrayTools::matmatProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
2338 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
2339 ">>> ERROR (ArrayTools::matmatProductDataData): inputDataLeft rank 2, 3 or 4 required.")
2343 switch(dataLeftRank){
2345 for(
size_t cell = 0; cell < numCells; cell++) {
2346 for(
size_t point = 0; point < numPoints; point++) {
2347 for(
size_t row = 0; row < matDim; row++) {
2348 for(
size_t col = 0; col < matDim; col++) {
2349 outputDataWrap(cell, point, row, col) = \
2350 inputDataLeftWrap(cell, 0)*inputDataRightWrap(point, row, col);
2358 for(
size_t cell = 0; cell < numCells; cell++) {
2359 for(
size_t point = 0; point < numPoints; point++) {
2360 for(
size_t row = 0; row < matDim; row++) {
2361 for(
size_t col = 0; col < matDim; col++) {
2362 outputDataWrap(cell, point, row, col) = \
2363 inputDataLeftWrap(cell, 0, row)*inputDataRightWrap(point, row, col);
2371 if ((transpose ==
'n') || (transpose ==
'N')) {
2372 for(
size_t cell = 0; cell < numCells; cell++){
2373 for(
size_t point = 0; point < numPoints; point++){
2374 for(
size_t row = 0; row < matDim; row++){
2375 for(
size_t col = 0; col < matDim; col++){
2376 outputDataWrap(cell, point, row, col) = 0.0;
2377 for(
size_t i = 0; i < matDim; i++){
2378 outputDataWrap(cell, point, row, col) += \
2379 inputDataLeftWrap(cell, 0, row, i)*inputDataRightWrap(point, i, col);
2386 else if ((transpose ==
't') || (transpose ==
'T')) {
2387 for(
size_t cell = 0; cell < numCells; cell++){
2388 for(
size_t point = 0; point < numPoints; point++){
2389 for(
size_t row = 0; row < matDim; row++){
2390 for(
size_t col = 0; col < matDim; col++){
2391 outputDataWrap(cell, point, row, col) = 0.0;
2392 for(
size_t i = 0; i < matDim; i++){
2393 outputDataWrap(cell, point, row, col) += \
2394 inputDataLeftWrap(cell, 0, i, row)*inputDataRightWrap(point, i, col);
2402 TEUCHOS_TEST_FOR_EXCEPTION( !( (transpose ==
'n') || (transpose ==
'N') || (transpose ==
't') || (transpose ==
'T') ), std::invalid_argument,
2403 ">>> ERROR (ArrayTools::matmatProductDataData): The transpose flag must be 'n', 'N', 't' or 'T'.");
2408 TEUCHOS_TEST_FOR_EXCEPTION( !( (dataLeftRank == 2) || (dataLeftRank == 3) || (dataLeftRank == 4) ), std::invalid_argument,
2409 ">>> ERROR (ArrayTools::matmatProductDataData): inputDataLeft rank 2, 3 or 4 required.")
2414 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
2415 ">>> ERROR (ArrayTools::matmatProductDataData): inputDataRight rank 3 or 4 required.")
2445 #if defined(Intrepid_SHOW_DEPRECATED_WARNINGS)
2447 #warning "The Intrepid package is deprecated"