Ignore:
Timestamp:
01/03/21 18:00:43 (3 years ago)
Author:
ymipsl
Message:

Adapt transformation algorithm to new infrastructure (on going...)

YM

File:
1 edited

Legend:

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

    r1988 r1999  
    4848 
    4949CAxisAlgorithmExtractDomain::CAxisAlgorithmExtractDomain(bool isSource, CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo) 
    50  : CAxisAlgorithmTransformation(isSource, axisDestination, domainSource), pos_(-1), reduction_(0) 
     50 : CAlgorithmTransformationTransfer(isSource), pos_(-1), axisDest_(axisDestination), domainSrc_(domainSource) 
    5151TRY 
    5252{ 
     
    6767 
    6868  pos_ = algo->position; 
    69   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    70 } 
    71 CATCH 
    7269 
    73 void CAxisAlgorithmExtractDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 
    74                                         const double* dataInput, 
    75                                         CArray<double,1>& dataOut, 
    76                                         std::vector<bool>& flagInitial,                      
    77                                         bool ignoreMissingValue, bool firstPass) 
    78 TRY 
    79 { 
    80   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    81 } 
    82 CATCH 
    83  
    84 CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain() 
    85 TRY 
    86 { 
    87   if (0 != reduction_) delete reduction_; 
    88 } 
    89 CATCH 
    90  
    91 void CAxisAlgorithmExtractDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    92 TRY 
    93 { 
    94   this->transformationMapping_.resize(1); 
    95   this->transformationWeight_.resize(1); 
    96  
    97   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    98   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
     70  auto& transMap = this->transformationMapping_; 
    9971 
    10072  CArray<int,1>& axisDstIndex = axisDest_->index; 
     
    10678    { 
    10779      int globalAxisIdx = axisDstIndex(idxAxis); 
    108       transMap[globalAxisIdx].resize(1); 
    109       transWeight[globalAxisIdx].resize(1); 
    110       transMap[globalAxisIdx][0] = globalAxisIdx * ni_glo + pos_; 
    111       transWeight[globalAxisIdx][0] = 1.0; 
    112  
     80      transMap[globalAxisIdx] = globalAxisIdx * ni_glo + pos_; 
    11381    } 
    11482  } 
     
    11987    { 
    12088      int globalAxisIdx = axisDstIndex(idxAxis); 
    121       transMap[globalAxisIdx].resize(1); 
    122       transWeight[globalAxisIdx].resize(1); 
    123       transMap[globalAxisIdx][0] = globalAxisIdx + ni_glo * pos_; 
    124       transWeight[globalAxisIdx][0] = 1.0; 
     89      transMap[globalAxisIdx] = globalAxisIdx + ni_glo * pos_; 
    12590    } 
    12691  } 
    12792  else 
    12893  {} 
     94 
     95  axisDestination->checkAttributes() ; 
     96  this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 
    12997} 
    13098CATCH 
     99 
     100 
     101CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain() 
     102TRY 
     103{ 
    131104} 
     105CATCH 
     106 
     107} 
Note: See TracChangeset for help on using the changeset viewer.