Changeset 1999 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp
- Timestamp:
- 01/03/21 18:00:43 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp
r1988 r1999 48 48 49 49 CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(bool isSource, CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo) 50 : C ScalarAlgorithmTransformation(isSource, scalarDestination, axisSource), reduction_(0)50 : CAlgorithmTransformationTransfer(isSource) 51 51 TRY 52 52 { 53 53 algo->checkValid(scalarDestination, axisSource); 54 StdString op = "extract";55 54 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)) ; 57 59 } 58 60 CATCH 59 61 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 TRY66 {67 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);68 }69 CATCH70 62 71 CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis()72 TRY73 {74 if (0 != reduction_) delete reduction_;75 }76 CATCH77 78 void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)79 TRY80 {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 CATCH91 63 92 64 }
Note: See TracChangeset
for help on using the changeset viewer.