Changeset 1564 for XIOS/trunk/src/distribution_client.cpp
- Timestamp:
- 07/20/18 14:02:55 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/distribution_client.cpp
r1562 r1564 68 68 break; 69 69 case 1: 70 readGridMaskInfo(grid->mask_1d);70 if (!grid->mask_1d.isEmpty()) readGridMaskInfo(grid->mask_1d); 71 71 break; 72 72 case 2: 73 readGridMaskInfo(grid->mask_2d);73 if (!grid->mask_2d.isEmpty()) readGridMaskInfo(grid->mask_2d); 74 74 break; 75 75 case 3: 76 readGridMaskInfo(grid->mask_3d);76 if (!grid->mask_3d.isEmpty()) readGridMaskInfo(grid->mask_3d); 77 77 break; 78 78 case 4: 79 readGridMaskInfo(grid->mask_4d);79 if (!grid->mask_4d.isEmpty()) readGridMaskInfo(grid->mask_4d); 80 80 break; 81 81 case 5: 82 readGridMaskInfo(grid->mask_5d);82 if (!grid->mask_5d.isEmpty()) readGridMaskInfo(grid->mask_5d); 83 83 break; 84 84 case 6: 85 readGridMaskInfo(grid->mask_6d);85 if (!grid->mask_6d.isEmpty()) readGridMaskInfo(grid->mask_6d); 86 86 break; 87 87 case 7: 88 readGridMaskInfo(grid->mask_7d);88 if (!grid->mask_7d.isEmpty()) readGridMaskInfo(grid->mask_7d); 89 89 break; 90 90 default: … … 411 411 size_t idx = 0, indexLocalDataOnClientCount = 0; 412 412 size_t ssize = 1; 413 413 414 for (int i = 0; i < numElement_; ++i) ssize *= eachElementSize[i]; 414 415 while (idx < ssize) … … 436 437 int gridMaskIndex = 0; 437 438 currentIndex[0] = elementLocalIndex_[0](i); 438 for (int k = 0; k < this->numElement_; ++k) 439 { 440 gridMaskIndex += (currentIndex[k])*elementNLocal_[k]; 441 } 442 443 if (gridMask_(gridMaskIndex)) 444 { 445 ++indexLocalDataOnClientCount; 446 } 439 440 // If defined, iterate on grid mask 441 if (!gridMask_.isEmpty()) 442 { 443 for (int k = 0; k < this->numElement_; ++k) 444 { 445 gridMaskIndex += (currentIndex[k])*elementNLocal_[k]; 446 } 447 if (gridMask_(gridMaskIndex)) ++indexLocalDataOnClientCount; 448 } 449 // If grid mask is not defined, iterate on elements' mask 450 else 451 { 452 bool maskTmp = true; 453 int idxDomain = 0, idxAxis = 0; 454 for (int elem = 0; elem < numElement_; ++elem) 455 { 456 if (2 == axisDomainOrder_(elem)) 457 { 458 maskTmp = maskTmp && domainMasks_[idxDomain](currentIndex[elem]); 459 ++idxDomain; 460 } 461 else if (1 == axisDomainOrder_(elem)) 462 { 463 maskTmp = maskTmp && axisMasks_[idxAxis](currentIndex[elem]); 464 ++idxAxis; 465 } 466 } 467 if (maskTmp) ++indexLocalDataOnClientCount; 468 } 469 447 470 } 448 471 idxLoop[0] += innerLoopSize; … … 518 541 } 519 542 520 if (gridMask_(gridMaskIndex)) 543 bool maskTmp = true; 544 // If defined, apply grid mask 545 if (!gridMask_.isEmpty()) 546 { 547 maskTmp = gridMask_(gridMaskIndex); 548 } 549 // If grid mask is not defined, apply elements' mask 550 else 551 { 552 int idxDomain = 0, idxAxis = 0; 553 for (int elem = 0; elem < numElement_; ++elem) 554 { 555 if (2 == axisDomainOrder_(elem)) 556 { 557 maskTmp = maskTmp && domainMasks_[idxDomain](currentIndex[elem]); 558 ++idxDomain; 559 } 560 else if (1 == axisDomainOrder_(elem)) 561 { 562 maskTmp = maskTmp && axisMasks_[idxAxis](currentIndex[elem]); 563 ++idxAxis; 564 } 565 } 566 } 567 568 if (maskTmp) 521 569 { 522 570 size_t globalIndex = 0;
Note: See TracChangeset
for help on using the changeset viewer.