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/scalar_algorithm/scalar_algorithm_extract_axis.cpp

    r1988 r1999  
    4848 
    4949CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(bool isSource, CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo) 
    50  : CScalarAlgorithmTransformation(isSource, scalarDestination, axisSource), reduction_(0) 
     50 : CAlgorithmTransformationTransfer(isSource) 
    5151TRY 
    5252{ 
    5353  algo->checkValid(scalarDestination, axisSource); 
    54   StdString op = "extract"; 
    5554  pos_ = algo->position; 
    56   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     55  this->transformationMapping_[0]=pos_ ; 
     56 
     57  scalarDestination->checkAttributes() ; 
     58  this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), scalarDestination->getLocalView(CElementView::WORKFLOW)) ; 
    5759} 
    5860CATCH 
    5961 
    60 void CScalarAlgorithmExtractAxis::apply(const std::vector<std::pair<int,double> >& localIndex, 
    61                                          const double* dataInput, 
    62                                          CArray<double,1>& dataOut, 
    63                                          std::vector<bool>& flagInitial,                      
    64                                          bool ignoreMissingValue, bool firstPass) 
    65 TRY 
    66 { 
    67   reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    68 } 
    69 CATCH 
    7062 
    71 CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis() 
    72 TRY 
    73 { 
    74   if (0 != reduction_) delete reduction_; 
    75 } 
    76 CATCH 
    77  
    78 void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
    79 TRY 
    80 { 
    81   this->transformationMapping_.resize(1); 
    82   this->transformationWeight_.resize(1); 
    83  
    84   TransformationIndexMap& transMap = this->transformationMapping_[0]; 
    85   TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    86  
    87   transMap[0].push_back(pos_); 
    88   transWeight[0].push_back(1.0); 
    89 } 
    90 CATCH 
    9163 
    9264} 
Note: See TracChangeset for help on using the changeset viewer.