Changeset 1999 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract_domain.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/axis_algorithm/axis_algorithm_extract_domain.cpp
r1988 r1999 48 48 49 49 CAxisAlgorithmExtractDomain::CAxisAlgorithmExtractDomain(bool isSource, CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo) 50 : CA xisAlgorithmTransformation(isSource, axisDestination, domainSource), pos_(-1), reduction_(0)50 : CAlgorithmTransformationTransfer(isSource), pos_(-1), axisDest_(axisDestination), domainSrc_(domainSource) 51 51 TRY 52 52 { … … 67 67 68 68 pos_ = algo->position; 69 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);70 }71 CATCH72 69 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_; 99 71 100 72 CArray<int,1>& axisDstIndex = axisDest_->index; … … 106 78 { 107 79 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_; 113 81 } 114 82 } … … 119 87 { 120 88 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_; 125 90 } 126 91 } 127 92 else 128 93 {} 94 95 axisDestination->checkAttributes() ; 96 this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 129 97 } 130 98 CATCH 99 100 101 CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain() 102 TRY 103 { 131 104 } 105 CATCH 106 107 }
Note: See TracChangeset
for help on using the changeset viewer.