1 #ifndef INTREPID_ARRAYTOOLSDEFSCALAR_HPP
2 #define INTREPID_ARRAYTOOLSDEFSCALAR_HPP
54 template<
class Scalar,
class ArrayOutFields,
class ArrayInData,
class ArrayInFields>
56 const ArrayInData & inputData,
57 const ArrayInFields & inputFields,
58 const bool reciprocal) {
59 #ifdef HAVE_INTREPID_DEBUG
60 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(inputData) != 2), std::invalid_argument,
61 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Input data container must have rank 2.");
62 if (getrank(outputFields) <= getrank(inputFields)) {
63 TEUCHOS_TEST_FOR_EXCEPTION( ( (getrank(inputFields) < 3) || (getrank(inputFields) > 5) ), std::invalid_argument,
64 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Input fields container must have rank 3, 4, or 5.");
65 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(outputFields) != getrank(inputFields)), std::invalid_argument,
66 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Input and output fields containers must have the same rank.");
67 TEUCHOS_TEST_FOR_EXCEPTION( (inputFields.dimension(0) != inputData.dimension(0) ), std::invalid_argument,
68 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Zeroth dimensions (number of integration domains) of the fields and data input containers must agree!");
69 TEUCHOS_TEST_FOR_EXCEPTION( ( (inputFields.dimension(2) != inputData.dimension(1)) && (inputData.dimension(1) != 1) ), std::invalid_argument,
70 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Second dimension of the fields input container and first dimension of data input container (number of integration points) must agree or first data dimension must be 1!");
71 for (
size_t i=0; i<getrank(inputFields); i++) {
72 std::string errmsg =
">>> ERROR (ArrayTools::scalarMultiplyDataField): Dimension ";
73 errmsg += (char)(48+i);
74 errmsg +=
" of the input and output fields containers must agree!";
75 TEUCHOS_TEST_FOR_EXCEPTION( (inputFields.dimension(i) != outputFields.dimension(i)), std::invalid_argument, errmsg );
79 TEUCHOS_TEST_FOR_EXCEPTION( ( (getrank(inputFields) < 2) || (getrank(inputFields) > 4) ), std::invalid_argument,
80 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Input fields container must have rank 2, 3, or 4.");
81 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(outputFields) != getrank(inputFields)+1), std::invalid_argument,
82 ">>> ERROR (ArrayTools::scalarMultiplyDataField): The rank of the input fields container must be one less than the rank of the output fields container.");
83 TEUCHOS_TEST_FOR_EXCEPTION( ( (inputFields.dimension(1) != inputData.dimension(1)) && (inputData.dimension(1) != 1) ), std::invalid_argument,
84 ">>> ERROR (ArrayTools::scalarMultiplyDataField): First dimensions of fields input container and data input container (number of integration points) must agree or first data dimension must be 1!");
85 TEUCHOS_TEST_FOR_EXCEPTION( ( inputData.dimension(0) != outputFields.dimension(0) ), std::invalid_argument,
86 ">>> ERROR (ArrayTools::scalarMultiplyDataField): Zeroth dimensions of fields output container and data input containers (number of integration domains) must agree!");
87 for (
size_t i=0; i<getrank(inputFields); i++) {
88 std::string errmsg =
">>> ERROR (ArrayTools::scalarMultiplyDataField): Dimensions ";
89 errmsg += (char)(48+i);
91 errmsg += (char)(48+i+1);
92 errmsg +=
" of the input and output fields containers must agree!";
93 TEUCHOS_TEST_FOR_EXCEPTION( (inputFields.dimension(i) != outputFields.dimension(i+1)), std::invalid_argument, errmsg );
102 size_t invalRank = getrank(inputFields);
103 size_t outvalRank = getrank(outputFields);
104 int numCells = outputFields.dimension(0);
105 int numFields = outputFields.dimension(1);
106 int numPoints = outputFields.dimension(2);
107 int numDataPoints = inputData.dimension(1);
110 if (outvalRank > 3) {
111 dim1Tens = outputFields.dimension(3);
112 if (outvalRank > 4) {
113 dim2Tens = outputFields.dimension(4);
117 if (outvalRank == invalRank) {
119 if (numDataPoints != 1) {
123 for(
int cl = 0; cl < numCells; cl++) {
124 for(
int bf = 0; bf < numFields; bf++) {
125 for(
int pt = 0; pt < numPoints; pt++) {
126 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(cl, bf, pt)/inputDataWrap(cl, pt);
134 for(
int cl = 0; cl < numCells; cl++) {
135 for(
int bf = 0; bf < numFields; bf++) {
136 for(
int pt = 0; pt < numPoints; pt++) {
137 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(cl, bf, pt)*inputDataWrap(cl, pt);
148 for(
int cl = 0; cl < numCells; cl++) {
149 for(
int bf = 0; bf < numFields; bf++) {
150 for(
int pt = 0; pt < numPoints; pt++) {
151 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
152 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(cl, bf, pt, iVec)/inputDataWrap(cl, pt);
159 for(
int cl = 0; cl < numCells; cl++) {
160 for(
int bf = 0; bf < numFields; bf++) {
161 for(
int pt = 0; pt < numPoints; pt++) {
162 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
163 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(cl, bf, pt, iVec)*inputDataWrap(cl, pt);
174 for(
int cl = 0; cl < numCells; cl++) {
175 for(
int bf = 0; bf < numFields; bf++) {
176 for(
int pt = 0; pt < numPoints; pt++) {
177 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
178 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
179 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(cl, bf, pt, iTens1, iTens2)/inputDataWrap(cl, pt);
187 for(
int cl = 0; cl < numCells; cl++) {
188 for(
int bf = 0; bf < numFields; bf++) {
189 for(
int pt = 0; pt < numPoints; pt++) {
190 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
191 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
192 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(cl, bf, pt, iTens1, iTens2)*inputDataWrap(cl, pt);
203 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 3) || (invalRank == 4) || (invalRank == 5) ), std::invalid_argument,
204 ">>> ERROR (ArrayTools::scalarMultiplyDataField): This branch of the method is defined only for rank-3,4 or 5 containers.");
213 for(
int cl = 0; cl < numCells; cl++) {
214 for(
int bf = 0; bf < numFields; bf++) {
215 for(
int pt = 0; pt < numPoints; pt++) {
216 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(cl, bf, pt)/inputDataWrap(cl, 0);
222 for(
int cl = 0; cl < numCells; cl++) {
223 for(
int bf = 0; bf < numFields; bf++) {
224 for(
int pt = 0; pt < numPoints; pt++) {
225 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(cl, bf, pt)*inputDataWrap(cl, 0);
235 for(
int cl = 0; cl < numCells; cl++) {
236 for(
int bf = 0; bf < numFields; bf++) {
237 for(
int pt = 0; pt < numPoints; pt++) {
238 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
239 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(cl, bf, pt, iVec)/inputDataWrap(cl, 0);
246 for(
int cl = 0; cl < numCells; cl++) {
247 for(
int bf = 0; bf < numFields; bf++) {
248 for(
int pt = 0; pt < numPoints; pt++) {
249 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
250 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(cl, bf, pt, iVec)*inputDataWrap(cl, 0);
261 for(
int cl = 0; cl < numCells; cl++) {
262 for(
int bf = 0; bf < numFields; bf++) {
263 for(
int pt = 0; pt < numPoints; pt++) {
264 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
265 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
266 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(cl, bf, pt, iTens1, iTens2)/inputDataWrap(cl, 0);
274 for(
int cl = 0; cl < numCells; cl++) {
275 for(
int bf = 0; bf < numFields; bf++) {
276 for(
int pt = 0; pt < numPoints; pt++) {
277 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
278 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
279 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(cl, bf, pt, iTens1, iTens2)*inputDataWrap(cl, 0);
290 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 3) || (invalRank == 4) || (invalRank == 5) ), std::invalid_argument,
291 ">>> ERROR (ArrayTools::scalarMultiplyDataField): This branch of the method is defined only for rank-3, 4 or 5 input containers.");
299 if (numDataPoints != 1) {
304 for(
int cl = 0; cl < numCells; cl++) {
305 for(
int bf = 0; bf < numFields; bf++) {
306 for(
int pt = 0; pt < numPoints; pt++) {
307 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(bf, pt)/inputDataWrap(cl, pt);
313 for(
int cl = 0; cl < numCells; cl++) {
314 for(
int bf = 0; bf < numFields; bf++) {
315 for(
int pt = 0; pt < numPoints; pt++) {
316 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(bf, pt)*inputDataWrap(cl, pt);
326 for(
int cl = 0; cl < numCells; cl++) {
327 for(
int bf = 0; bf < numFields; bf++) {
328 for(
int pt = 0; pt < numPoints; pt++) {
329 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
330 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(bf, pt, iVec)/inputDataWrap(cl, pt);
337 for(
int cl = 0; cl < numCells; cl++) {
338 for(
int bf = 0; bf < numFields; bf++) {
339 for(
int pt = 0; pt < numPoints; pt++) {
340 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
341 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(bf, pt, iVec)*inputDataWrap(cl, pt);
352 for(
int cl = 0; cl < numCells; cl++) {
353 for(
int bf = 0; bf < numFields; bf++) {
354 for(
int pt = 0; pt < numPoints; pt++) {
355 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
356 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
357 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(bf, pt, iTens1, iTens2)/inputDataWrap(cl, pt);
365 for(
int cl = 0; cl < numCells; cl++) {
366 for(
int bf = 0; bf < numFields; bf++) {
367 for(
int pt = 0; pt < numPoints; pt++) {
368 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
369 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
370 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(bf, pt, iTens1, iTens2)*inputDataWrap(cl, pt);
381 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 4) ), std::invalid_argument,
382 ">>> ERROR (ArrayTools::scalarMultiplyDataField): This branch of the method is defined only for rank-2, 3 or 4 input containers.");
391 for(
int cl = 0; cl < numCells; cl++) {
392 for(
int bf = 0; bf < numFields; bf++) {
393 for(
int pt = 0; pt < numPoints; pt++) {
394 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(bf, pt)/inputDataWrap(cl, 0);
400 for(
int cl = 0; cl < numCells; cl++) {
401 for(
int bf = 0; bf < numFields; bf++) {
402 for(
int pt = 0; pt < numPoints; pt++) {
403 outputFieldsWrap(cl, bf, pt) = inputFieldsWrap(bf, pt)*inputDataWrap(cl, 0);
413 for(
int cl = 0; cl < numCells; cl++) {
414 for(
int bf = 0; bf < numFields; bf++) {
415 for(
int pt = 0; pt < numPoints; pt++) {
416 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
417 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(bf, pt, iVec)/inputDataWrap(cl, 0);
424 for(
int cl = 0; cl < numCells; cl++) {
425 for(
int bf = 0; bf < numFields; bf++) {
426 for(
int pt = 0; pt < numPoints; pt++) {
427 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
428 outputFieldsWrap(cl, bf, pt, iVec) = inputFieldsWrap(bf, pt, iVec)*inputDataWrap(cl, 0);
439 for(
int cl = 0; cl < numCells; cl++) {
440 for(
int bf = 0; bf < numFields; bf++) {
441 for(
int pt = 0; pt < numPoints; pt++) {
442 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
443 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
444 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(bf, pt, iTens1, iTens2)/inputDataWrap(cl, 0);
452 for(
int cl = 0; cl < numCells; cl++) {
453 for(
int bf = 0; bf < numFields; bf++) {
454 for(
int pt = 0; pt < numPoints; pt++) {
455 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
456 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
457 outputFieldsWrap(cl, bf, pt, iTens1, iTens2) = inputFieldsWrap(bf, pt, iTens1, iTens2)*inputDataWrap(cl, 0);
468 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 3) ), std::invalid_argument,
469 ">>> ERROR (ArrayTools::scalarMultiplyDataField): This branch of the method is defined only for rank-2, 3 or 4 input containers.");
478 template<
class Scalar,
class ArrayOutData,
class ArrayInDataLeft,
class ArrayInDataRight>
480 const ArrayInDataLeft & inputDataLeft,
481 const ArrayInDataRight & inputDataRight,
482 const bool reciprocal) {
484 #ifdef HAVE_INTREPID_DEBUG
485 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(inputDataLeft) != 2), std::invalid_argument,
486 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Left input data container must have rank 2.");
487 if (getrank(outputData) <= getrank(inputDataRight)) {
488 TEUCHOS_TEST_FOR_EXCEPTION( ( (getrank(inputDataRight) < 2) || (getrank(inputDataRight) > 4) ), std::invalid_argument,
489 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Right input data container must have rank 2, 3, or 4.");
490 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(outputData) != getrank(inputDataRight)), std::invalid_argument,
491 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Right input and output data containers must have the same rank.");
492 TEUCHOS_TEST_FOR_EXCEPTION( (inputDataRight.dimension(0) != inputDataLeft.dimension(0) ), std::invalid_argument,
493 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Zeroth dimensions (number of integration domains) of the left and right data input containers must agree!");
494 TEUCHOS_TEST_FOR_EXCEPTION( ( (inputDataRight.dimension(1) != inputDataLeft.dimension(1)) && (inputDataLeft.dimension(1) != 1) ), std::invalid_argument,
495 ">>> ERROR (ArrayTools::scalarMultiplyDataData): First dimensions of the left and right data input containers (number of integration points) must agree or first dimension of the left data input container must be 1!");
496 for (
size_t i=0; i<getrank(inputDataRight); i++) {
497 std::string errmsg =
">>> ERROR (ArrayTools::scalarMultiplyDataData): Dimension ";
498 errmsg += (char)(48+i);
499 errmsg +=
" of the right input and output data containers must agree!";
500 TEUCHOS_TEST_FOR_EXCEPTION( (inputDataRight.dimension(i) != outputData.dimension(i)), std::invalid_argument, errmsg );
504 TEUCHOS_TEST_FOR_EXCEPTION( ( (getrank(inputDataRight) < 1) || (getrank(inputDataRight) > 3) ), std::invalid_argument,
505 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Right input data container must have rank 1, 2, or 3.");
506 TEUCHOS_TEST_FOR_EXCEPTION( (getrank(outputData) != getrank(inputDataRight)+1), std::invalid_argument,
507 ">>> ERROR (ArrayTools::scalarMultiplyDataData): The rank of the right input data container must be one less than the rank of the output data container.");
508 TEUCHOS_TEST_FOR_EXCEPTION( ( (inputDataRight.dimension(0) != inputDataLeft.dimension(1)) && (inputDataLeft.dimension(1) != 1) ), std::invalid_argument,
509 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Zeroth dimension of the right input data container and first dimension of the left data input container (number of integration points) must agree or first dimension of the left data input container must be 1!");
510 TEUCHOS_TEST_FOR_EXCEPTION( ( inputDataLeft.dimension(0) != outputData.dimension(0) ), std::invalid_argument,
511 ">>> ERROR (ArrayTools::scalarMultiplyDataData): Zeroth dimensions of data output and left data input containers (number of integration domains) must agree!");
512 for (
size_t i=0; i<getrank(inputDataRight); i++) {
513 std::string errmsg =
">>> ERROR (ArrayTools::scalarMultiplyDataData): Dimensions ";
514 errmsg += (char)(48+i);
516 errmsg += (char)(48+i+1);
517 errmsg +=
" of the right input and output data containers must agree!";
518 TEUCHOS_TEST_FOR_EXCEPTION( (inputDataRight.dimension(i) != outputData.dimension(i+1)), std::invalid_argument, errmsg );
530 size_t invalRank = getrank(inputDataRight);
531 size_t outvalRank = getrank(outputData);
532 int numCells = outputData.dimension(0);
533 int numPoints = outputData.dimension(1);
534 int numDataPoints = inputDataLeft.dimension(1);
537 if (outvalRank > 2) {
538 dim1Tens = outputData.dimension(2);
539 if (outvalRank > 3) {
540 dim2Tens = outputData.dimension(3);
544 if (outvalRank == invalRank) {
546 if (numDataPoints != 1) {
551 for(
int cl = 0; cl < numCells; cl++) {
552 for(
int pt = 0; pt < numPoints; pt++) {
553 outputDataWrap(cl, pt) = inputDataRightWrap(cl, pt)/inputDataLeftWrap(cl, pt);
558 for(
int cl = 0; cl < numCells; cl++) {
559 for(
int pt = 0; pt < numPoints; pt++) {
560 outputDataWrap(cl, pt) = inputDataRightWrap(cl, pt)*inputDataLeftWrap(cl, pt);
569 for(
int cl = 0; cl < numCells; cl++) {
570 for(
int pt = 0; pt < numPoints; pt++) {
571 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
572 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(cl, pt, iVec)/inputDataLeftWrap(cl, pt);
578 for(
int cl = 0; cl < numCells; cl++) {
579 for(
int pt = 0; pt < numPoints; pt++) {
580 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
581 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(cl, pt, iVec)*inputDataLeftWrap(cl, pt);
591 for(
int cl = 0; cl < numCells; cl++) {
592 for(
int pt = 0; pt < numPoints; pt++) {
593 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
594 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
595 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(cl, pt, iTens1, iTens2)/inputDataLeftWrap(cl, pt);
602 for(
int cl = 0; cl < numCells; cl++) {
603 for(
int pt = 0; pt < numPoints; pt++) {
604 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
605 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
606 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(cl, pt, iTens1, iTens2)*inputDataLeftWrap(cl, pt);
616 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 4) ), std::invalid_argument,
617 ">>> ERROR (ArrayTools::scalarMultiplyDataData): This branch of the method is defined only for rank-2, 3 or 4 containers.");
626 for(
int cl = 0; cl < numCells; cl++) {
627 for(
int pt = 0; pt < numPoints; pt++) {
628 outputDataWrap(cl, pt) = inputDataRightWrap(cl, pt)/inputDataLeftWrap(cl, 0);
633 for(
int cl = 0; cl < numCells; cl++) {
634 for(
int pt = 0; pt < numPoints; pt++) {
635 outputDataWrap(cl, pt) = inputDataRightWrap(cl, pt)*inputDataLeftWrap(cl, 0);
644 for(
int cl = 0; cl < numCells; cl++) {
645 for(
int pt = 0; pt < numPoints; pt++) {
646 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
647 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(cl, pt, iVec)/inputDataLeftWrap(cl, 0);
653 for(
int cl = 0; cl < numCells; cl++) {
654 for(
int pt = 0; pt < numPoints; pt++) {
655 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
656 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(cl, pt, iVec)*inputDataLeftWrap(cl, 0);
666 for(
int cl = 0; cl < numCells; cl++) {
667 for(
int pt = 0; pt < numPoints; pt++) {
668 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
669 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
670 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(cl, pt, iTens1, iTens2)/inputDataLeftWrap(cl, 0);
677 for(
int cl = 0; cl < numCells; cl++) {
678 for(
int pt = 0; pt < numPoints; pt++) {
679 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
680 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
681 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(cl, pt, iTens1, iTens2)*inputDataLeftWrap(cl, 0);
691 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 4) ), std::invalid_argument,
692 ">>> ERROR (ArrayTools::scalarMultiplyDataData): This branch of the method is defined only for rank-2, 3 or 4 input containers.");
700 if (numDataPoints != 1) {
705 for(
int cl = 0; cl < numCells; cl++) {
706 for(
int pt = 0; pt < numPoints; pt++) {
707 outputDataWrap(cl, pt) = inputDataRightWrap(pt)/inputDataLeftWrap(cl, pt);
712 for(
int cl = 0; cl < numCells; cl++) {
713 for(
int pt = 0; pt < numPoints; pt++) {
714 outputDataWrap(cl, pt) = inputDataRightWrap(pt)*inputDataLeftWrap(cl, pt);
723 for(
int cl = 0; cl < numCells; cl++) {
724 for(
int pt = 0; pt < numPoints; pt++) {
725 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
726 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(pt, iVec)/inputDataLeftWrap(cl, pt);
732 for(
int cl = 0; cl < numCells; cl++) {
733 for(
int pt = 0; pt < numPoints; pt++) {
734 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
735 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(pt, iVec)*inputDataLeftWrap(cl, pt);
745 for(
int cl = 0; cl < numCells; cl++) {
746 for(
int pt = 0; pt < numPoints; pt++) {
747 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
748 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
749 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(pt, iTens1, iTens2)/inputDataLeftWrap(cl, pt);
756 for(
int cl = 0; cl < numCells; cl++) {
757 for(
int pt = 0; pt < numPoints; pt++) {
758 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
759 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
760 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(pt, iTens1, iTens2)*inputDataLeftWrap(cl, pt);
770 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 1) || (invalRank == 2) || (invalRank == 3) ), std::invalid_argument,
771 ">>> ERROR (ArrayTools::scalarMultiplyDataData): This branch of the method is defined only for rank-1, 2 or 3 input containers.");
780 for(
int cl = 0; cl < numCells; cl++) {
781 for(
int pt = 0; pt < numPoints; pt++) {
782 outputDataWrap(cl, pt) = inputDataRightWrap(pt)/inputDataLeftWrap(cl, 0);
787 for(
int cl = 0; cl < numCells; cl++) {
788 for(
int pt = 0; pt < numPoints; pt++) {
789 outputDataWrap(cl, pt) = inputDataRightWrap(pt)*inputDataLeftWrap(cl, 0);
798 for(
int cl = 0; cl < numCells; cl++) {
799 for(
int pt = 0; pt < numPoints; pt++) {
800 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
801 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(pt, iVec)/inputDataLeftWrap(cl, 0);
807 for(
int cl = 0; cl < numCells; cl++) {
808 for(
int pt = 0; pt < numPoints; pt++) {
809 for(
int iVec = 0; iVec < dim1Tens; iVec++) {
810 outputDataWrap(cl, pt, iVec) = inputDataRightWrap(pt, iVec)*inputDataLeftWrap(cl, 0);
820 for(
int cl = 0; cl < numCells; cl++) {
821 for(
int pt = 0; pt < numPoints; pt++) {
822 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
823 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
824 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(pt, iTens1, iTens2)/inputDataLeftWrap(cl, 0);
831 for(
int cl = 0; cl < numCells; cl++) {
832 for(
int pt = 0; pt < numPoints; pt++) {
833 for(
int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
834 for(
int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
835 outputDataWrap(cl, pt, iTens1, iTens2) = inputDataRightWrap(pt, iTens1, iTens2)*inputDataLeftWrap(cl, 0);
845 TEUCHOS_TEST_FOR_EXCEPTION( !( (invalRank == 1) || (invalRank == 2) || (invalRank == 3) ), std::invalid_argument,
846 ">>> ERROR (ArrayTools::scalarMultiplyDataData): This branch of the method is defined only for rank-1, 2 or 3 input containers.");