Changeset 2226 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
- Timestamp:
- 09/09/21 13:05:36 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
r2190 r2226 94 94 domainDestination->i_index.resize( indexSize ); 95 95 domainDestination->j_index.resize( indexSize ); 96 for (size_t i = 0; i < indexSize ; ++i) { 96 for (size_t i = 0; i < indexSize ; ++i) 97 { 97 98 domainDestination->i_index(i) = sourceGlobalIdx(i)%domainSource->ni_glo; 98 99 domainDestination->j_index(i) = sourceGlobalIdx(i)/domainSource->ni_glo; … … 104 105 // - domainDestination->j_index = 0; 105 106 106 // set mask_1d to enable domainMask computing (in checkMask())107 // set data_i_index to enable localMask computing (in computeLocalMask()), used to compute Workflow View 107 108 CArray<int,1> sourceWorkflowIdx = domainSource->getLocalView(CElementView::WORKFLOW)->getIndex(); 108 CArray<int,1> sourceFullIdx = domainSource->getLocalView(CElementView::FULL )->getIndex(); 109 domainDestination->mask_1d.resize( indexSize ); 110 int countMasked(0); // countMasked will store the offset index between full and workflow views 111 for (size_t i = 0; i < indexSize ; ++i) { 112 if ( ( (i-countMasked) >= sourceWorkflowIdx.numElements() ) 113 || ( sourceFullIdx(i)!=sourceWorkflowIdx(i-countMasked) ) ) { 114 domainDestination->mask_1d(i) = 0; 115 countMasked++; 116 } 117 else { 118 domainDestination->mask_1d(i) = 1; 119 } 109 domainDestination->data_i_index.resize( indexSize ); 110 domainDestination->data_i_index = -1; 111 domainDestination->data_j_index.resize( indexSize ); 112 domainDestination->data_j_index = 0; 113 int srcWorkflowSize = sourceWorkflowIdx.numElements(); 114 for (size_t i = 0; i < srcWorkflowSize ; ++i) 115 { 116 domainDestination->data_i_index(sourceWorkflowIdx(i)) = sourceWorkflowIdx(i); 120 117 } 121 118
Note: See TracChangeset
for help on using the changeset viewer.