- Timestamp:
- 01/23/19 10:31:44 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_scalar.cpp
r1545 r1642 9 9 #include "grid.hpp" 10 10 #include "grid_transformation_factory_impl.hpp" 11 11 #include "reduction.hpp" 12 12 13 13 … … 22 22 std::map<int, int>& elementPositionInGridDst2AxisPosition, 23 23 std::map<int, int>& elementPositionInGridDst2DomainPosition) 24 TRY 24 25 { 25 26 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 32 33 return (new CScalarAlgorithmReduceScalar(scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], reduceScalar)); 33 34 } 35 CATCH 34 36 35 37 bool CScalarAlgorithmReduceScalar::registerTrans() 38 TRY 36 39 { 37 40 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create); 38 41 } 42 CATCH 39 43 40 44 CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo) 41 45 : CScalarAlgorithmTransformation(scalarDestination, scalarSource), 42 46 reduction_(0) 47 TRY 43 48 { 44 49 eliminateRedondantSrc_= false ; … … 70 75 71 76 } 72 73 if(CReductionAlgorithm::ReductionOperations_ptr == 0)74 {75 CReductionAlgorithm::initReductionOperation();76 }77 77 78 if (CReductionAlgorithm::ReductionOperations _ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op))78 if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 79 79 ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)", 80 80 << "Operation '" << op << "' not found. Please make sure to use a supported one" … … 82 82 << "Scalar destination " << scalarDestination->getId()); 83 83 84 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations _ptr->at(op));84 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 85 85 } 86 CATCH 86 87 87 88 void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 88 89 std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 90 TRY 89 91 { 90 92 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 91 93 } 94 CATCH 92 95 93 96 void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut) 97 TRY 94 98 { 95 99 reduction_->updateData(dataOut); 96 100 } 101 CATCH 97 102 98 103 CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar() 104 TRY 99 105 { 100 106 if (0 != reduction_) delete reduction_; 101 107 } 108 CATCH 102 109 103 110 void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 111 TRY 104 112 { 105 113 this->transformationMapping_.resize(1); … … 113 121 114 122 } 123 CATCH 115 124 116 125 }
Note: See TracChangeset
for help on using the changeset viewer.