Changeset 1993 for XIOS


Ignore:
Timestamp:
12/17/20 12:55:12 (3 years ago)
Author:
ymipsl
Message:

bug fix in chaining transformations

YM

File:
1 edited

Legend:

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

    r1984 r1993  
    77    donePath_ = transformationPaths.donePath_ ; 
    88    //? if (donePath_.empty()) donePath_.push_back(transformationPaths.path_) ; // entry point 
    9      
     9    if (get<1>(remainPath_)!="") return ; 
     10 
    1011    if (!donePath_.empty()) 
    1112    { 
     
    2324        } 
    2425 
    25         if (remoteIt==get<2>(remotePath).end()) get<2>(remainPath_).insert( get<2>(remainPath_).begin(), it , std::get<2>(path_).end() ) ; 
     26        if (remoteIt==get<2>(remotePath).end())  
     27        { 
     28          get<0>(remainPath_) = std::get<0>(path_) ; 
     29          get<1>(remainPath_) = std::get<1>(path_) ; 
     30          get<2>(remainPath_).insert( get<2>(remainPath_).begin(), it , std::get<2>(path_).end() ) ; 
     31        } 
    2632        else  remainPath_ = path_ ; 
    2733 
     
    3339      remainPath_=path_ ; 
    3440    }  
     41    get<1>(path_).clear() ; 
     42    get<2>(path_).clear() ; 
    3543  } 
    3644   
     
    3846  { 
    3947    CTransformationPaths transformationPath ; 
     48   /* TPath newPath = path_ ; 
     49    get<2>(newPath).clear() ; 
     50    transformationPath.donePath_.push_back(newPath) ; */ 
    4051    mergePaths(transformationPath) ; 
    4152  } 
     
    5667  string CTransformationPaths::getNextElementId(void) 
    5768  { 
     69    CTransformationPaths transformationPath = *this ; 
     70    transformationPath.removeNextTransform() ; 
     71    return transformationPath.getPathsId(transformationPath.donePath_) ; 
     72    /* 
    5873    string sep="/" ; 
    5974    string doneId=getPathsId(donePath_) ; 
     
    6479    if (remainId=="") sep="" ; 
    6580    return doneId+sep+remainId ; 
     81   */ 
    6682  } 
    6783 
     
    89105      get<1>(newPath)=get<1>(remainPath_) ; 
    90106      if (!get<2>(remainPath_).empty()) get<2>(newPath).push_back(get<2>(remainPath_).front()) ; 
    91       donePath_.push_back(newPath); 
    92       get<1>(newPath)="" ; 
     107      if (donePath_.empty()) donePath_.push_back(newPath); 
     108      else 
     109      { 
     110        if (get<0>(donePath_.back())==get<0>(newPath) && get<1>(donePath_.back())==get<1>(newPath))  
     111          get<2>(donePath_.back()).push_back(get<2>(newPath).front()) ; 
     112        else donePath_.push_back(newPath); 
     113      } 
    93114      if (!get<2>(newPath).empty()) get<2>(remainPath_).pop_front() ; 
     115      if (get<2>(remainPath_).empty()) get<1>(remainPath_)="" ; 
    94116    } 
    95117    else 
Note: See TracChangeset for help on using the changeset viewer.