00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00035 namespace Intrepid {
00036
00037 template<class Scalar, class ArrayOutFields, class ArrayInData, class ArrayInFields>
00038 void ArrayTools::dotMultiplyDataField(ArrayOutFields & outputFields,
00039 const ArrayInData & inputData,
00040 const ArrayInFields & inputFields) {
00041
00042 #ifdef HAVE_INTREPID_DEBUG
00043 if (inputFields.rank() > inputData.rank()) {
00044 TEST_FOR_EXCEPTION( ((inputData.rank() < 2) || (inputData.rank() > 4)), std::invalid_argument,
00045 ">>> ERROR (ArrayTools::dotMultiplyDataField): Input data container must have rank 2, 3 or 4.");
00046 TEST_FOR_EXCEPTION( (inputFields.rank() != inputData.rank()+1), std::invalid_argument,
00047 ">>> ERROR (ArrayTools::dotMultiplyDataField): Input fields container must have rank one larger than the rank of the input data container.");
00048 TEST_FOR_EXCEPTION( (outputFields.rank() != 3), std::invalid_argument,
00049 ">>> ERROR (ArrayTools::dotMultiplyDataField): Output fields container must have rank 3.");
00050 TEST_FOR_EXCEPTION( (inputFields.dimension(0) != inputData.dimension(0) ), std::invalid_argument,
00051 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimensions (number of integration domains) of the fields and data input containers must agree!");
00052 TEST_FOR_EXCEPTION( ( (inputFields.dimension(2) != inputData.dimension(1)) && (inputData.dimension(1) != 1) ), std::invalid_argument,
00053 ">>> ERROR (ArrayTools::dotMultiplyDataField): 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!");
00054 for (int i=2; i<inputData.rank(); i++) {
00055 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataField): Dimensions ";
00056 errmsg += (char)(48+i);
00057 errmsg += " and ";
00058 errmsg += (char)(48+i+1);
00059 errmsg += " of the input data and fields containers must agree!";
00060 TEST_FOR_EXCEPTION( (inputData.dimension(i) != inputFields.dimension(i+1)), std::invalid_argument, errmsg );
00061 }
00062 for (int i=0; i<outputFields.rank(); i++) {
00063 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataField): Dimensions ";
00064 errmsg += (char)(48+i);
00065 errmsg += " of the input and output fields containers must agree!";
00066 TEST_FOR_EXCEPTION( (inputFields.dimension(i) != outputFields.dimension(i)), std::invalid_argument, errmsg );
00067 }
00068 }
00069 else {
00070 TEST_FOR_EXCEPTION( ((inputData.rank() < 2) || (inputData.rank() > 4)), std::invalid_argument,
00071 ">>> ERROR (ArrayTools::dotMultiplyDataField): Input data container must have rank 2, 3 or 4.");
00072 TEST_FOR_EXCEPTION( (inputFields.rank() != inputData.rank()), std::invalid_argument,
00073 ">>> ERROR (ArrayTools::dotMultiplyDataField): The rank of fields input container must equal the rank of data input container.");
00074 TEST_FOR_EXCEPTION( (outputFields.rank() != 3), std::invalid_argument,
00075 ">>> ERROR (ArrayTools::dotMultiplyDataField): Output fields container must have rank 3.");
00076 TEST_FOR_EXCEPTION( ( (inputFields.dimension(1) != inputData.dimension(1)) && (inputData.dimension(1) != 1) ), std::invalid_argument,
00077 ">>> ERROR (ArrayTools::dotMultiplyDataField): First dimensions of the fields and data input containers (number of integration points) must agree or first data dimension must be 1!");
00078 TEST_FOR_EXCEPTION( (inputFields.dimension(0) != outputFields.dimension(1)), std::invalid_argument,
00079 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimension of the fields input container and first dimension of the fields output container (number of fields) must agree!");
00080 TEST_FOR_EXCEPTION( (inputFields.dimension(1) != outputFields.dimension(2)), std::invalid_argument,
00081 ">>> ERROR (ArrayTools::dotMultiplyDataField): First dimension of the fields input container and second dimension of the fields output container (number of integration points) must agree!");
00082 TEST_FOR_EXCEPTION( (outputFields.dimension(0) != inputData.dimension(0)), std::invalid_argument,
00083 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimensions of the fields output and data input containers (number of integration domains) must agree!");
00084 for (int i=2; i<inputData.rank(); i++) {
00085 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataField): Dimensions ";
00086 errmsg += (char)(48+i);
00087 errmsg += " of the input data and fields containers must agree!";
00088 TEST_FOR_EXCEPTION( (inputData.dimension(i) != inputFields.dimension(i)), std::invalid_argument, errmsg );
00089 }
00090 }
00091 #endif
00092
00093
00094 int invalRank = inputFields.rank();
00095 int dataRank = inputData.rank();
00096 int numCells = outputFields.dimension(0);
00097 int numFields = outputFields.dimension(1);
00098 int numPoints = outputFields.dimension(2);
00099 int numDataPoints = inputData.dimension(1);
00100 int dim1Tens = 0;
00101 int dim2Tens = 0;
00102 if (dataRank > 2) {
00103 dim1Tens = inputData.dimension(2);
00104 if (dataRank > 3) {
00105 dim2Tens = inputData.dimension(3);
00106 }
00107 }
00108
00109 Scalar temp(0);
00110
00111 if (invalRank == dataRank + 1) {
00112
00113 if (numDataPoints != 1) {
00114
00115 switch(invalRank) {
00116 case 3: {
00117 for(int cl = 0; cl < numCells; cl++) {
00118 for(int bf = 0; bf < numFields; bf++) {
00119 for(int pt = 0; pt < numPoints; pt++) {
00120 outputFields(cl, bf, pt) = inputData(cl, pt)*inputFields(cl, bf, pt);
00121 }
00122 }
00123 }
00124 }
00125 break;
00126
00127 case 4: {
00128 for(int cl = 0; cl < numCells; cl++) {
00129 for(int bf = 0; bf < numFields; bf++) {
00130 for(int pt = 0; pt < numPoints; pt++) {
00131 temp = 0;
00132 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00133 temp += inputData(cl, pt, iVec)*inputFields(cl, bf, pt, iVec);
00134 }
00135 outputFields(cl, bf, pt) = temp;
00136 }
00137 }
00138 }
00139 }
00140 break;
00141
00142 case 5: {
00143 for(int cl = 0; cl < numCells; cl++) {
00144 for(int bf = 0; bf < numFields; bf++) {
00145 for(int pt = 0; pt < numPoints; pt++) {
00146 temp = 0;
00147 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00148 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00149 temp += inputData(cl, pt, iTens1, iTens2)*inputFields(cl, bf, pt, iTens1, iTens2);
00150 }
00151 }
00152 outputFields(cl, bf, pt) = temp;
00153 }
00154 }
00155 }
00156 }
00157 break;
00158
00159 default:
00160 TEST_FOR_EXCEPTION( !( (invalRank == 3) || (invalRank == 4) || (invalRank == 5) ), std::invalid_argument,
00161 ">>> ERROR (ArrayTools::dotMultiplyDataField): This branch of the method is defined only for rank-3, 4 or 5 input fields containers.");
00162 }
00163
00164 }
00165 else {
00166
00167 switch(invalRank) {
00168 case 3: {
00169 for(int cl = 0; cl < numCells; cl++) {
00170 for(int bf = 0; bf < numFields; bf++) {
00171 for(int pt = 0; pt < numPoints; pt++) {
00172 outputFields(cl, bf, pt) = inputData(cl, 0)*inputFields(cl, bf, pt);
00173 }
00174 }
00175 }
00176 }
00177 break;
00178
00179 case 4: {
00180 for(int cl = 0; cl < numCells; cl++) {
00181 for(int bf = 0; bf < numFields; bf++) {
00182 for(int pt = 0; pt < numPoints; pt++) {
00183 temp = 0;
00184 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00185 temp += inputData(cl, 0, iVec)*inputFields(cl, bf, pt, iVec);
00186 }
00187 outputFields(cl, bf, pt) = temp;
00188 }
00189 }
00190 }
00191 }
00192 break;
00193
00194 case 5: {
00195 for(int cl = 0; cl < numCells; cl++) {
00196 for(int bf = 0; bf < numFields; bf++) {
00197 for(int pt = 0; pt < numPoints; pt++) {
00198 temp = 0;
00199 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00200 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00201 temp += inputData(cl, 0, iTens1, iTens2)*inputFields(cl, bf, pt, iTens1, iTens2);
00202 }
00203 }
00204 outputFields(cl, bf, pt) = temp;
00205 }
00206 }
00207 }
00208 }
00209 break;
00210
00211 default:
00212 TEST_FOR_EXCEPTION( !( (invalRank == 3) || (invalRank == 4) || (invalRank == 5) ), std::invalid_argument,
00213 ">>> ERROR (ArrayTools::dotMultiplyDataField): This branch of the method is defined only for rank-3, 4 or 5 input fields containers.");
00214 }
00215
00216 }
00217
00218 }
00219 else {
00220
00221 if (numDataPoints != 1) {
00222
00223 switch(invalRank) {
00224 case 2: {
00225 for(int cl = 0; cl < numCells; cl++) {
00226 for(int bf = 0; bf < numFields; bf++) {
00227 for(int pt = 0; pt < numPoints; pt++) {
00228 outputFields(cl, bf, pt) = inputData(cl, pt)*inputFields(bf, pt);
00229 }
00230 }
00231 }
00232 }
00233 break;
00234
00235 case 3: {
00236 for(int cl = 0; cl < numCells; cl++) {
00237 for(int bf = 0; bf < numFields; bf++) {
00238 for(int pt = 0; pt < numPoints; pt++) {
00239 temp = 0;
00240 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00241 temp += inputData(cl, pt, iVec)*inputFields(bf, pt, iVec);
00242 }
00243 outputFields(cl, bf, pt) = temp;
00244 }
00245 }
00246 }
00247 }
00248 break;
00249
00250 case 4: {
00251 for(int cl = 0; cl < numCells; cl++) {
00252 for(int bf = 0; bf < numFields; bf++) {
00253 for(int pt = 0; pt < numPoints; pt++) {
00254 temp = 0;
00255 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00256 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00257 temp += inputData(cl, pt, iTens1, iTens2)*inputFields(bf, pt, iTens1, iTens2);
00258 }
00259 }
00260 outputFields(cl, bf, pt) = temp;
00261 }
00262 }
00263 }
00264 }
00265 break;
00266
00267 default:
00268 TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 4) ), std::invalid_argument,
00269 ">>> ERROR (ArrayTools::dotMultiplyDataField): This branch of the method is defined only for rank-2, 3 or 4 input fields containers.");
00270 }
00271
00272 }
00273 else {
00274
00275 switch(invalRank) {
00276 case 2: {
00277 for(int cl = 0; cl < numCells; cl++) {
00278 for(int bf = 0; bf < numFields; bf++) {
00279 for(int pt = 0; pt < numPoints; pt++) {
00280 outputFields(cl, bf, pt) = inputData(cl, 0)*inputFields(bf, pt);
00281 }
00282 }
00283 }
00284 }
00285 break;
00286
00287 case 3: {
00288 for(int cl = 0; cl < numCells; cl++) {
00289 for(int bf = 0; bf < numFields; bf++) {
00290 for(int pt = 0; pt < numPoints; pt++) {
00291 temp = 0;
00292 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00293 temp += inputData(cl, 0, iVec)*inputFields(bf, pt, iVec);
00294 }
00295 outputFields(cl, bf, pt) = temp;
00296 }
00297 }
00298 }
00299 }
00300 break;
00301
00302 case 4: {
00303 for(int cl = 0; cl < numCells; cl++) {
00304 for(int bf = 0; bf < numFields; bf++) {
00305 for(int pt = 0; pt < numPoints; pt++) {
00306 temp = 0;
00307 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00308 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00309 temp += inputData(cl, 0, iTens1, iTens2)*inputFields(bf, pt, iTens1, iTens2);
00310 }
00311 }
00312 outputFields(cl, bf, pt) = temp;
00313 }
00314 }
00315 }
00316 }
00317 break;
00318
00319 default:
00320 TEST_FOR_EXCEPTION( !( (invalRank == 2) || (invalRank == 3) || (invalRank == 4) ), std::invalid_argument,
00321 ">>> ERROR (ArrayTools::dotMultiplyDataField): This branch of the method is defined only for rank-2, 3 or 4 input fields containers.");
00322 }
00323
00324 }
00325
00326 }
00327
00328 }
00329
00330
00331
00332 template<class Scalar, class ArrayOutData, class ArrayInDataLeft, class ArrayInDataRight>
00333 void ArrayTools::dotMultiplyDataData(ArrayOutData & outputData,
00334 const ArrayInDataLeft & inputDataLeft,
00335 const ArrayInDataRight & inputDataRight) {
00336
00337 #ifdef HAVE_INTREPID_DEBUG
00338 if (inputDataRight.rank() >= inputDataLeft.rank()) {
00339 TEST_FOR_EXCEPTION( ((inputDataLeft.rank() < 2) || (inputDataLeft.rank() > 4)), std::invalid_argument,
00340 ">>> ERROR (ArrayTools::dotMultiplyDataData): Left data input container must have rank 2, 3 or 4.");
00341 TEST_FOR_EXCEPTION( (inputDataRight.rank() != inputDataLeft.rank()), std::invalid_argument,
00342 ">>> ERROR (ArrayTools::dotMultiplyDataData): The rank of the right data input container must equal the rank of the left data input container.");
00343 TEST_FOR_EXCEPTION( (outputData.rank() != 2), std::invalid_argument,
00344 ">>> ERROR (ArrayTools::dotMultiplyDataData): Data output container must have rank 2.");
00345 TEST_FOR_EXCEPTION( ( (inputDataRight.dimension(1) != inputDataLeft.dimension(1)) && (inputDataLeft.dimension(1) != 1) ), std::invalid_argument,
00346 ">>> ERROR (ArrayTools::dotMultiplyDataField): First dimensions of the left and right data input containers (number of integration points) must agree or first left data dimension must be 1!");
00347 for (int i=0; i<inputDataLeft.rank(); i++) {
00348 if (i != 1) {
00349 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataData): Dimensions ";
00350 errmsg += (char)(48+i);
00351 errmsg += " of the left and right data input containers must agree!";
00352 TEST_FOR_EXCEPTION( (inputDataLeft.dimension(i) != inputDataRight.dimension(i)), std::invalid_argument, errmsg );
00353 }
00354 }
00355 for (int i=0; i<outputData.rank(); i++) {
00356 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataData): Dimensions ";
00357 errmsg += (char)(48+i);
00358 errmsg += " of the output and right input data containers must agree!";
00359 TEST_FOR_EXCEPTION( (inputDataRight.dimension(i) != outputData.dimension(i)), std::invalid_argument, errmsg );
00360 }
00361 }
00362 else {
00363 TEST_FOR_EXCEPTION( ((inputDataLeft.rank() < 2) || (inputDataLeft.rank() > 4)), std::invalid_argument,
00364 ">>> ERROR (ArrayTools::dotMultiplyDataData): Left data input container must have rank 2, 3 or 4.");
00365 TEST_FOR_EXCEPTION( (inputDataRight.rank() != inputDataLeft.rank()-1), std::invalid_argument,
00366 ">>> ERROR (ArrayTools::dotMultiplyDataData): Right data input container must have rank one less than the rank of left data input container.");
00367 TEST_FOR_EXCEPTION( (outputData.rank() != 2), std::invalid_argument,
00368 ">>> ERROR (ArrayTools::dotMultiplyDataData): Data output container must have rank 2.");
00369 TEST_FOR_EXCEPTION( ( (inputDataRight.dimension(0) != inputDataLeft.dimension(1)) && (inputDataLeft.dimension(1) != 1) ), std::invalid_argument,
00370 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimension of the right data input container and first dimension of left data input container (number of integration points) must agree or first left data dimension must be 1!");
00371 TEST_FOR_EXCEPTION( (inputDataRight.dimension(0) != outputData.dimension(1)), std::invalid_argument,
00372 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimension of the right data input container and first dimension of output data container (number of integration points) must agree!");
00373 TEST_FOR_EXCEPTION( (inputDataLeft.dimension(0) != outputData.dimension(0)), std::invalid_argument,
00374 ">>> ERROR (ArrayTools::dotMultiplyDataField): Zeroth dimensions of the left data input and data output containers (number of integration domains) must agree!");
00375 for (int i=1; i<inputDataRight.rank(); i++) {
00376 std::string errmsg = ">>> ERROR (ArrayTools::dotMultiplyDataData): Dimensions ";
00377 errmsg += (char)(48+i+1);
00378 errmsg += " and ";
00379 errmsg += (char)(48+i);
00380 errmsg += " of the left and right data input containers must agree!";
00381 TEST_FOR_EXCEPTION( (inputDataLeft.dimension(i+1) != inputDataRight.dimension(i)), std::invalid_argument, errmsg );
00382 }
00383 }
00384 #endif
00385
00386
00387 int rightDataRank = inputDataRight.rank();
00388 int leftDataRank = inputDataLeft.rank();
00389 int numCells = outputData.dimension(0);
00390 int numPoints = outputData.dimension(1);
00391 int numDataPoints = inputDataLeft.dimension(1);
00392 int dim1Tens = 0;
00393 int dim2Tens = 0;
00394 if (leftDataRank > 2) {
00395 dim1Tens = inputDataLeft.dimension(2);
00396 if (leftDataRank > 3) {
00397 dim2Tens = inputDataLeft.dimension(3);
00398 }
00399 }
00400
00401 Scalar temp(0);
00402
00403 if (rightDataRank == leftDataRank) {
00404
00405 if (numDataPoints != 1) {
00406
00407 switch(rightDataRank) {
00408 case 2: {
00409 for(int cl = 0; cl < numCells; cl++) {
00410 for(int pt = 0; pt < numPoints; pt++) {
00411 outputData(cl, pt) = inputDataLeft(cl, pt)*inputDataRight(cl, pt);
00412 }
00413 }
00414 }
00415 break;
00416
00417 case 3: {
00418 for(int cl = 0; cl < numCells; cl++) {
00419 for(int pt = 0; pt < numPoints; pt++) {
00420 temp = 0;
00421 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00422 temp += inputDataLeft(cl, pt, iVec)*inputDataRight(cl, pt, iVec);
00423 }
00424 outputData(cl, pt) = temp;
00425 }
00426 }
00427 }
00428 break;
00429
00430 case 4: {
00431 for(int cl = 0; cl < numCells; cl++) {
00432 for(int pt = 0; pt < numPoints; pt++) {
00433 temp = 0;
00434 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00435 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00436 temp += inputDataLeft(cl, pt, iTens1, iTens2)*inputDataRight(cl, pt, iTens1, iTens2);
00437 }
00438 }
00439 outputData(cl, pt) = temp;
00440 }
00441 }
00442 }
00443 break;
00444
00445 default:
00446 TEST_FOR_EXCEPTION( !( (rightDataRank == 2) || (rightDataRank == 3) || (rightDataRank == 4) ), std::invalid_argument,
00447 ">>> ERROR (ArrayTools::dotMultiplyDataData): This branch of the method is defined only for rank-2, 3 or 4 right data input containers.");
00448 }
00449
00450 }
00451 else {
00452
00453 switch(rightDataRank) {
00454 case 2: {
00455 for(int cl = 0; cl < numCells; cl++) {
00456 for(int pt = 0; pt < numPoints; pt++) {
00457 outputData(cl, pt) = inputDataLeft(cl, 0)*inputDataRight(cl, pt);
00458 }
00459 }
00460 }
00461 break;
00462
00463 case 3: {
00464 for(int cl = 0; cl < numCells; cl++) {
00465 for(int pt = 0; pt < numPoints; pt++) {
00466 temp = 0;
00467 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00468 temp += inputDataLeft(cl, 0, iVec)*inputDataRight(cl, pt, iVec);
00469 }
00470 outputData(cl, pt) = temp;
00471 }
00472 }
00473 }
00474 break;
00475
00476 case 4: {
00477 for(int cl = 0; cl < numCells; cl++) {
00478 for(int pt = 0; pt < numPoints; pt++) {
00479 temp = 0;
00480 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00481 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00482 temp += inputDataLeft(cl, 0, iTens1, iTens2)*inputDataRight(cl, pt, iTens1, iTens2);
00483 }
00484 }
00485 outputData(cl, pt) = temp;
00486 }
00487 }
00488 }
00489 break;
00490
00491 default:
00492 TEST_FOR_EXCEPTION( !( (rightDataRank == 2) || (rightDataRank == 3) || (rightDataRank == 4) ), std::invalid_argument,
00493 ">>> ERROR (ArrayTools::dotMultiplyDataData): This branch of the method is defined only for rank-2, 3 or 4 right data input containers.");
00494 }
00495
00496 }
00497
00498 }
00499 else {
00500
00501 if (numDataPoints != 1) {
00502
00503 switch(rightDataRank) {
00504 case 1: {
00505 for(int cl = 0; cl < numCells; cl++) {
00506 for(int pt = 0; pt < numPoints; pt++) {
00507 outputData(cl, pt) = inputDataLeft(cl, pt)*inputDataRight(pt);
00508 }
00509 }
00510 }
00511 break;
00512
00513 case 2: {
00514 for(int cl = 0; cl < numCells; cl++) {
00515 for(int pt = 0; pt < numPoints; pt++) {
00516 temp = 0;
00517 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00518 temp += inputDataLeft(cl, pt, iVec)*inputDataRight(pt, iVec);
00519 }
00520 outputData(cl, pt) = temp;
00521 }
00522 }
00523 }
00524 break;
00525
00526 case 3: {
00527 for(int cl = 0; cl < numCells; cl++) {
00528 for(int pt = 0; pt < numPoints; pt++) {
00529 temp = 0;
00530 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00531 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00532 temp += inputDataLeft(cl, pt, iTens1, iTens2)*inputDataRight(pt, iTens1, iTens2);
00533 }
00534 }
00535 outputData(cl, pt) = temp;
00536 }
00537 }
00538 }
00539 break;
00540
00541 default:
00542 TEST_FOR_EXCEPTION( !( (rightDataRank == 1) || (rightDataRank == 2) || (rightDataRank == 3) ), std::invalid_argument,
00543 ">>> ERROR (ArrayTools::dotMultiplyDataData): This branch of the method is defined only for rank-1, 2 or 3 right data input containers.");
00544 }
00545
00546 }
00547 else {
00548
00549 switch(rightDataRank) {
00550 case 1: {
00551 for(int cl = 0; cl < numCells; cl++) {
00552 for(int pt = 0; pt < numPoints; pt++) {
00553 outputData(cl, pt) = inputDataLeft(cl, 0)*inputDataRight(pt);
00554 }
00555 }
00556 }
00557 break;
00558
00559 case 2: {
00560 for(int cl = 0; cl < numCells; cl++) {
00561 for(int pt = 0; pt < numPoints; pt++) {
00562 temp = 0;
00563 for( int iVec = 0; iVec < dim1Tens; iVec++) {
00564 temp += inputDataLeft(cl, 0, iVec)*inputDataRight(pt, iVec);
00565 }
00566 outputData(cl, pt) = temp;
00567 }
00568 }
00569 }
00570 break;
00571
00572 case 3: {
00573 for(int cl = 0; cl < numCells; cl++) {
00574 for(int pt = 0; pt < numPoints; pt++) {
00575 temp = 0;
00576 for(int iTens2 = 0; iTens2 < dim2Tens; iTens2++) {
00577 for( int iTens1 = 0; iTens1 < dim1Tens; iTens1++) {
00578 temp += inputDataLeft(cl, 0, iTens1, iTens2)*inputDataRight(pt, iTens1, iTens2);
00579 }
00580 }
00581 outputData(cl, pt) = temp;
00582 }
00583 }
00584 }
00585 break;
00586
00587 default:
00588 TEST_FOR_EXCEPTION( !( (rightDataRank == 1) || (rightDataRank == 2) || (rightDataRank == 3) ), std::invalid_argument,
00589 ">>> ERROR (ArrayTools::dotMultiplyDataData): This branch of the method is defined only for rank-1, 2 or 3 right data input containers.");
00590 }
00591
00592 }
00593
00594 }
00595
00596 }
00597
00598
00599
00600 }