Ignore:
Timestamp:
09/09/21 13:05:36 (3 years ago)
Author:
jderouillat
Message:

Implement a data_i_index computing which only depends on source workflow view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r2190 r2226  
    9494   domainDestination->i_index.resize( indexSize ); 
    9595   domainDestination->j_index.resize( indexSize ); 
    96    for (size_t i = 0; i < indexSize ; ++i) { 
     96   for (size_t i = 0; i < indexSize ; ++i) 
     97   { 
    9798     domainDestination->i_index(i) = sourceGlobalIdx(i)%domainSource->ni_glo; 
    9899     domainDestination->j_index(i) = sourceGlobalIdx(i)/domainSource->ni_glo; 
     
    104105   //   - domainDestination->j_index = 0; 
    105106 
    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 
    107108   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); 
    120117   } 
    121118 
Note: See TracChangeset for help on using the changeset viewer.