- Timestamp:
- 12/17/20 13:18:57 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.cpp
r1988 r1998 44 44 45 45 CAxisAlgorithmDuplicateScalar::CAxisAlgorithmDuplicateScalar(bool isSource, CAxis* axisDestination, CScalar* scalarSource, CDuplicateScalarToAxis* algo) 46 : CA xisAlgorithmTransformation(isSource, axisDestination, scalarSource)46 : CAlgorithmTransformationTransfer(isSource) 47 47 { 48 49 CArray<int,1>& axisDstIndex = axisDest_->index; 48 50 51 int nbAxisIdx = axisDstIndex.numElements(); 52 for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis) 53 { 54 int globalAxisIdx = axisDstIndex(idxAxis); 55 this->transformationMapping_[globalAxisIdx] = 0 ; 56 } 57 58 axisDestination->checkAttributes() ; 59 this->computeAlgorithm(scalarSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 49 60 } 50 61 … … 54 65 } 55 66 56 void CAxisAlgorithmDuplicateScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)57 TRY58 {59 this->transformationMapping_.resize(1);60 this->transformationWeight_.resize(1);61 62 TransformationIndexMap& transMap = this->transformationMapping_[0];63 TransformationWeightMap& transWeight = this->transformationWeight_[0];64 65 CArray<int,1>& axisDstIndex = axisDest_->index;66 67 int nbAxisIdx = axisDstIndex.numElements();68 for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)69 {70 int globalAxisIdx = axisDstIndex(idxAxis);71 transMap[globalAxisIdx].resize(1);72 transWeight[globalAxisIdx].resize(1);73 transMap[globalAxisIdx][0] = 0 ;74 transWeight[globalAxisIdx][0] = 1.0 ;75 }76 67 } 77 CATCH78 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.hpp
r1988 r1998 10 10 #define __XIOS_AXIS_ALGORITHM_DUPLICATE_SCALAR_HPP__ 11 11 12 #include "a xis_algorithm_transformation.hpp"12 #include "algorithm_transformation_transfer.hpp" 13 13 #include "transformation.hpp" 14 14 … … 24 24 Duplicate scalar into axis destination 25 25 */ 26 class CAxisAlgorithmDuplicateScalar : public CA xisAlgorithmTransformation26 class CAxisAlgorithmDuplicateScalar : public CAlgorithmTransformationTransfer 27 27 { 28 28 public: … … 33 33 static bool registerTrans(); 34 34 35 protected:36 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);37 35 38 36 private: 37 38 CAxis* axisSrc_; 39 CAxis* axisDest_; 40 39 41 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 40 42 CTransformation<CAxis>* transformation, -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.cpp
r1988 r1998 41 41 42 42 CAxisAlgorithmExtract::CAxisAlgorithmExtract(bool isSource, CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis) 43 : CA xisAlgorithmTransformation(isSource, axisDestination,axisSource)43 : CAlgorithmTransformationTransfer(isSource), axisDest_(axisDestination), axisSrc_(axisSource) 44 44 TRY 45 45 { … … 83 83 if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 84 84 85 this->transformationMapping_.resize(1); 86 this->transformationWeight_.resize(1); 87 TransformationIndexMap& transMap = this->transformationMapping_[0]; 88 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 85 auto& transMap = this->transformationMapping_; 89 86 90 87 for (int iDest = 0; iDest < nDest; iDest++) … … 106 103 indGloDest = axisDest_->index(iDest); 107 104 indGloSrc = axisSrc_->index(iSrc); 108 transMap[indGloDest].push_back(indGloSrc);109 trans Weight[indGloDest].push_back(1.0);105 106 transMap[indGloDest]=indGloSrc; 110 107 111 108 } 109 110 axisDestination->checkAttributes() ; 111 112 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 112 113 } 113 114 CATCH 114 115 115 /*! 116 Compute the index mapping between domain on grid source and one on grid destination 117 */ 118 void CAxisAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 119 { 120 } 116 121 117 122 118 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.hpp
r1988 r1998 6 6 #define __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__ 7 7 8 #include "a xis_algorithm_transformation.hpp"8 #include "algorithm_transformation_transfer.hpp" 9 9 #include "transformation.hpp" 10 10 … … 19 19 Only this extracted region is extracted to write on Netcdf. 20 20 */ 21 class CAxisAlgorithmExtract : public CA xisAlgorithmTransformation21 class CAxisAlgorithmExtract : public CAlgorithmTransformationTransfer 22 22 { 23 23 public: … … 27 27 28 28 static bool registerTrans(); 29 protected:30 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);31 29 32 30 private: … … 45 43 46 44 private: 47 45 CAxis* axisSrc_; 46 CAxis* axisDest_; 48 47 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 49 48 CTransformation<CAxis>* transformation, -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp
r1988 r1998 41 41 42 42 CAxisAlgorithmZoom::CAxisAlgorithmZoom(bool isSource, CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis) 43 : CA xisAlgorithmTransformation(isSource, axisDestination,axisSource)43 : CAlgorithmTransformationTransfer(isSource), axisDest_(axisDestination), axisSrc_(axisSource) 44 44 TRY 45 45 { … … 83 83 if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 84 84 85 this->transformationMapping_.resize(1); 86 this->transformationWeight_.resize(1); 87 TransformationIndexMap& transMap = this->transformationMapping_[0]; 88 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 85 auto& transMap = this->transformationMapping_; 89 86 90 87 for (int iDest = 0; iDest < nDest; iDest++) … … 106 103 indGloDest = axisDest_->index(iDest); 107 104 indGloSrc = axisSrc_->index(iSrc); 108 transMap[indGloDest].push_back(indGloSrc); 109 transWeight[indGloDest].push_back(1.0); 105 transMap[indGloDest]=indGloSrc; 110 106 111 107 } 108 109 axisDestination->checkAttributes() ; 110 111 this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ; 112 112 } 113 113 CATCH 114 114 115 /*!116 Compute the index mapping between domain on grid source and one on grid destination117 */118 void CAxisAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)119 {120 }121 115 122 116 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.hpp
r1988 r1998 6 6 #define __XIOS_AXIS_ALGORITHM_ZOOM_HPP__ 7 7 8 #include "a xis_algorithm_transformation.hpp"8 #include "algorithm_transformation_transfer.hpp" 9 9 #include "transformation.hpp" 10 10 … … 19 19 Only this zoomed region is zoomed to write on Netcdf. 20 20 */ 21 class CAxisAlgorithmZoom : public CA xisAlgorithmTransformation21 class CAxisAlgorithmZoom : public CAlgorithmTransformationTransfer 22 22 { 23 23 public: … … 27 27 28 28 static bool registerTrans(); 29 protected:30 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);31 29 32 30 private: … … 45 43 46 44 private: 45 46 CAxis* axisSrc_; 47 CAxis* axisDest_; 47 48 48 49 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
Note: See TracChangeset
for help on using the changeset viewer.