Ignore:
Timestamp:
12/06/20 22:14:56 (4 years ago)
Author:
ymipsl
Message:

intermediate commit for new tranformation engine?
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp

    r1975 r1984  
    135135   * Go through the hierarchy to find the scalar from which the transformations must be inherited 
    136136   */ 
    137   void CScalar::solveInheritanceTransformation() 
     137  void CScalar::solveInheritanceTransformation_old() 
    138138  { 
    139139    if (hasTransformation() || !hasDirectScalarReference()) 
     
    153153  } 
    154154  
     155  void CScalar::solveInheritanceTransformation() 
     156  TRY 
     157  { 
     158    if (solveInheritanceTransformation_done_) return; 
     159    else solveInheritanceTransformation_done_=true ; 
     160 
     161    CScalar* scalar = this; 
     162    CScalar* Lastscalar ; 
     163    std::list<CScalar*> refScalars; 
     164    bool out=false ; 
     165    vector<StdString> excludedAttr; 
     166    excludedAttr.push_back("scalar_ref"); 
     167     
     168    refScalars.push_front(scalar) ; 
     169    while (scalar->hasDirectScalarReference() && !out) 
     170    { 
     171      CScalar* lastScalar=scalar ; 
     172      scalar = scalar->getDirectScalarReference(); 
     173      scalar->solveRefInheritance() ; 
     174      if (!scalar->SuperClass::isEqual(lastScalar,excludedAttr)) out=true ; 
     175      refScalars.push_front(scalar) ; 
     176    } 
     177 
     178    CTransformationPaths::TPath path ; 
     179    auto& pathList = std::get<2>(path) ; 
     180    std::get<0>(path) = EElement::SCALAR ; 
     181    std::get<1>(path) = refScalars.front()->getId() ; 
     182    for (auto& scalar : refScalars) 
     183    { 
     184      CScalar::TransMapTypes transformations = scalar->getAllTransformations(); 
     185      for(auto& transformation : transformations) pathList.push_back({transformation.second->getTransformationType(),  
     186                                                                      transformation.second->getId()}) ; 
     187    } 
     188    transformationPaths_.addPath(path) ; 
     189 
     190  } 
     191  CATCH_DUMP_ATTR 
     192 
    155193  /* obsolete, to remove after reimplementing coupling */ 
    156194  void CScalar::sendScalarToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid) 
Note: See TracChangeset for help on using the changeset viewer.