- 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_axis.cpp
r1545 r1642 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 #include "reduction.hpp" 15 16 16 17 #include "reduction.hpp" 17 18 18 19 namespace xios { … … 26 27 std::map<int, int>& elementPositionInGridDst2AxisPosition, 27 28 std::map<int, int>& elementPositionInGridDst2DomainPosition) 29 TRY 28 30 { 29 31 std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); … … 36 38 return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 37 39 } 40 CATCH 38 41 39 42 bool CScalarAlgorithmReduceAxis::registerTrans() 43 TRY 40 44 { 41 45 CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create); 42 46 } 47 CATCH 43 48 44 49 CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo) 45 50 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 46 51 reduction_(0) 52 TRY 47 53 { 48 54 if (algo->operation.isEmpty()) … … 74 80 } 75 81 76 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 77 { 78 CReductionAlgorithm::initReductionOperation(); 79 } 80 81 if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 82 if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 82 83 ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 83 84 << "Operation '" << op << "' not found. Please make sure to use a supported one" … … 85 86 << "Scalar destination " << scalarDestination->getId()); 86 87 87 reduction_ = CReductionAlgorithm::createOperation( (*CReductionAlgorithm::ReductionOperations_ptr)[op]);88 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 88 89 } 90 CATCH 89 91 90 92 void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 91 93 std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 94 TRY 92 95 { 93 96 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 94 97 } 98 CATCH 95 99 96 100 void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 101 TRY 97 102 { 98 103 reduction_->updateData(dataOut); 99 104 } 105 CATCH 100 106 101 107 CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis() 108 TRY 102 109 { 103 110 if (0 != reduction_) delete reduction_; 104 111 } 112 CATCH 105 113 106 114 void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 115 TRY 107 116 { 108 117 this->transformationMapping_.resize(1); … … 120 129 } 121 130 } 131 CATCH 122 132 123 133 }
Note: See TracChangeset
for help on using the changeset viewer.