- Timestamp:
- 12/17/20 13:18:57 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation
- Files:
-
- 21 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, -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp
r1988 r1998 47 47 CDomainAlgorithmComputeConnectivity::CDomainAlgorithmComputeConnectivity(bool isSource, CDomain* domainDestination, CDomain* domainSource, 48 48 CComputeConnectivityDomain* compute_connectivityDomain) 49 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource)49 : CAlgorithmTransformationNoDataModification(isSource) 50 50 TRY 51 51 { … … 103 103 CATCH 104 104 105 /*!106 Compute the index mapping between domain on grid source and one on grid destination107 */108 void CDomainAlgorithmComputeConnectivity::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)109 {110 105 } 111 112 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.hpp
r1988 r1998 10 10 #define __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__ 11 11 12 #include " domain_algorithm_transformation.hpp"12 #include "algorithm_transformation_no_data_modification.hpp" 13 13 #include "transformation.hpp" 14 14 … … 20 20 \class CDomainAlgorithmComputeConnectivity 21 21 */ 22 class CDomainAlgorithmComputeConnectivity : public C DomainAlgorithmTransformation22 class CDomainAlgorithmComputeConnectivity : public CAlgorithmTransformationNoDataModification 23 23 { 24 24 public: … … 28 28 29 29 static bool registerTrans(); 30 protected:31 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);32 30 33 31 protected: -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.cpp
r1988 r1998 50 50 CDomain* domainSource, 51 51 CExpandDomain* expandDomain) 52 : CDomainAlgorithmTransformation(isSource, domainDestination, domainSource), 53 isXPeriodic_(false), isYPeriodic_(false) 52 : CAlgorithmTransformationTransfer(isSource), isXPeriodic_(false), isYPeriodic_(false) 54 53 TRY 55 54 { … … 61 60 << "Domain destination " <<domainDestination->getId() << std::endl); 62 61 } 63 64 this->type_ = (ELEMENT_MODIFICATION_WITH_DATA);65 62 // Make sure domain source have all valid attributes 66 63 // domainSource->checkAllAttributes(); … … 82 79 break; 83 80 } 81 82 domainDestination->checkAttributes() ; 83 this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 84 84 } 85 85 CATCH … … 291 291 // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 292 292 // Global index mapping between destination and source 293 this->transformationMapping_.resize(1); 294 this->transformationWeight_.resize(1); 295 TransformationIndexMap& transMap = this->transformationMapping_[0]; 296 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 297 298 transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 299 transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 293 294 transformationMapping_.rehash(std::ceil(newNbLocalDst/transformationMapping_.max_load_factor())); 300 295 301 296 // Index mapping for local domain … … 311 306 globalIndexSrcOnDstDomain(idx) = globIndexSrc; 312 307 313 transMap[globIndexDst].push_back(globIndexSrc); 314 transWeight[globIndexDst].push_back(1.0); 308 transformationMapping_[globIndexDst] = globIndexSrc; 315 309 } 316 310 … … 569 563 // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 570 564 // Global index mapping between destination and source 571 this->transformationMapping_.resize(1); 572 this->transformationWeight_.resize(1); 573 TransformationIndexMap& transMap = this->transformationMapping_[0]; 574 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 575 576 transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 577 transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 565 566 transformationMapping_.rehash(std::ceil(newNbLocalDst/transformationMapping_.max_load_factor())); 578 567 // First, index mapping for local domain 579 568 for (int idx = 0; idx < oldNbLocal; ++idx) 580 569 { 581 570 index = i_index_dst(idx); 582 transMap[index].push_back(index); 583 transWeight[index].push_back(1.0); 571 transformationMapping_[index] = index ; 584 572 } 585 573 // Then, index mapping for extended part … … 590 578 i_index_dst(index) = globalIndex; 591 579 j_index_dst(index) = 0; 592 transMap[globalIndex].push_back(globalIndex); 593 transWeight[globalIndex].push_back(1.0); 580 transformationMapping_[globalIndex]=globalIndex; 594 581 } 595 582 … … 704 691 CATCH 705 692 706 /*! 707 Compute the index mapping between domain on grid source and one on grid destination 708 */ 709 void CDomainAlgorithmExpand::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 710 { 711 712 } 713 714 } 693 694 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.hpp
r1988 r1998 10 10 #define __XIOS_DOMAIN_ALGORITHM_EXPAND_HPP__ 11 11 12 #include " domain_algorithm_transformation.hpp"12 #include "algorithm_transformation_transfer.hpp" 13 13 #include "transformation.hpp" 14 14 … … 20 20 \class CDomainAlgorithmExpand 21 21 */ 22 class CDomainAlgorithmExpand : public C DomainAlgorithmTransformation22 class CDomainAlgorithmExpand : public CAlgorithmTransformationTransfer 23 23 { 24 24 public: … … 44 44 CArray<int,2>& neighborsDomainSrc); 45 45 46 protected:47 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);48 49 46 private: 50 47 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.cpp
r1988 r1998 38 38 39 39 CDomainAlgorithmExtract::CDomainAlgorithmExtract(bool isSource, CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain) 40 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource)40 : CAlgorithmTransformationTransfer(isSource), domainSrc_(domainSource), domainDest_(domainDestination) 41 41 TRY 42 42 { … … 151 151 } 152 152 if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 153 154 this->transformationMapping_.resize(1); 155 this->transformationWeight_.resize(1); 156 TransformationIndexMap& transMap = this->transformationMapping_[0]; 157 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 158 153 159 154 for (int iDest = 0; iDest < niDest; iDest++) 160 155 { … … 219 214 } 220 215 221 transMap[indGloDest].push_back(indGloSrc); 222 transWeight[indGloDest].push_back(1.0); 216 transformationMapping_[indGloDest]=indGloSrc; 223 217 224 218 } … … 242 236 CATCH 243 237 244 /*! 245 Compute the index mapping between domain on grid source and one on grid destination 246 */ 247 void CDomainAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 248 { 249 } 250 251 252 } 238 239 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.hpp
r1988 r1998 3 3 #define __XIOS_DOMAIN_ALGORITHM_EXTRACT_HPP__ 4 4 5 #include "domain_algorithm_transformation.hpp"6 5 #include "transformation.hpp" 6 #include "algorithm_transformation_transfer.hpp" 7 7 8 8 namespace xios { … … 15 15 Implementing extract (alternative zoom) on domain 16 16 */ 17 class CDomainAlgorithmExtract : public C DomainAlgorithmTransformation17 class CDomainAlgorithmExtract : public CAlgorithmTransformationTransfer 18 18 { 19 19 public: … … 23 23 24 24 static bool registerTrans(); 25 protected:26 void updateDomainAttributes();27 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);28 29 private:30 void updateExtract();31 25 32 26 private: … … 42 36 int extractNi_; 43 37 int extractNj_; 38 39 CDomain* domainSrc_ ; 40 CDomain* domainDest_ ; 44 41 45 42 private: -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.cpp
r1988 r1998 54 54 CGrid* gridDest, CGrid* gridSource, 55 55 CGenerateRectilinearDomain* genRectDomain) 56 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource), nbDomainDistributedPart_(0)56 : CAlgorithmTransformationNoDataModification(isSource), nbDomainDistributedPart_(0), domainDest_(domainDestination) 57 57 TRY 58 58 { 59 type_ = ELEMENT_GENERATION;60 59 genRectDomain->checkValid(domainDestination); 61 60 if (0 != gridSource) computeDistributionGridSource(gridSource); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp
r1988 r1998 10 10 #define __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__ 11 11 12 #include " domain_algorithm_transformation.hpp"12 #include "algorithm_transformation_no_data_modification.hpp" 13 13 #include "transformation.hpp" 14 14 … … 25 25 The number of processes is deduced from the distribution of the grid source. 26 26 */ 27 class CDomainAlgorithmGenerateRectilinear : public C DomainAlgorithmTransformation27 class CDomainAlgorithmGenerateRectilinear : public CAlgorithmTransformationNoDataModification 28 28 { 29 29 public: … … 53 53 private: 54 54 int nbDomainDistributedPart_; //! Number of local domain. 55 CDomain* domainDest_ ; 55 56 56 57 static bool dummyRegistered_; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.cpp
r1988 r1998 53 53 54 54 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(bool isSource, CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 55 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false)55 : CAlgorithmTransformationWeight(isSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false), domainSrc_(domainSource), domainDest_(domainDestination) 56 56 TRY 57 57 { … … 97 97 98 98 writeToFile_ = interpDomain_->write_weight; 99 domainDestination->checkAttributes() ; 100 101 if (readFromFile_) readRemapInfo(); 102 else computeRemap(); 103 104 this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 99 105 100 106 } … … 504 510 CATCH 505 511 506 /*!507 Compute the index mapping between domain on grid source and one on grid destination508 */509 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)510 TRY511 {512 if (readFromFile_)513 readRemapInfo();514 else515 {516 computeRemap();517 }518 }519 CATCH520 512 521 513 void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) … … 542 534 int clientRank = context->intraCommRank_; 543 535 544 this->transformationMapping_.resize(1); 545 this->transformationWeight_.resize(1); 546 547 TransformationIndexMap& transMap = this->transformationMapping_[0]; 548 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 536 TransformationIndexMap& transMap = this->transformationMapping_; 537 TransformationWeightMap& transWeight = this->transformationWeight_; 549 538 550 539 std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it, … … 573 562 int nbClient = context-> intraCommSize_; 574 563 575 this->transformationMapping_.resize(1); 576 this->transformationWeight_.resize(1); 577 578 TransformationIndexMap& transMap = this->transformationMapping_[0]; 579 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 564 TransformationIndexMap& transMap = this->transformationMapping_; 565 TransformationWeightMap& transWeight = this->transformationWeight_; 580 566 581 567 std::unordered_map<size_t,int> globalIndexOfDomainDest; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp
r1988 r1998 10 10 #define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__ 11 11 12 #include " domain_algorithm_transformation.hpp"12 #include "algorithm_transformation_weight.hpp" 13 13 #include "transformation.hpp" 14 14 #include "nc4_data_output.hpp" … … 24 24 Reading interpolation from file then apply on a domain 25 25 */ 26 class CDomainAlgorithmInterpolate : public C DomainAlgorithmTransformation26 class CDomainAlgorithmInterpolate : public CAlgorithmTransformationWeight 27 27 { 28 28 public: … … 39 39 40 40 static bool registerTrans(); 41 protected:42 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);43 41 44 42 private: … … 98 96 std::map<int, int>& elementPositionInGridDst2DomainPosition); 99 97 static bool dummyRegistered_; 98 99 CDomain* domainSrc_ ; 100 CDomain* domainDest_ ; 101 100 102 }; 101 103 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
r1988 r1998 41 41 42 42 CDomainAlgorithmReorder::CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain) 43 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource)43 : CAlgorithmTransformationNoDataModification(isSource) 44 44 TRY 45 45 { … … 118 118 CATCH 119 119 120 /*!121 Compute the index mapping between domain on grid source and one on grid destination122 */123 void CDomainAlgorithmReorder::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)124 {125 /*126 this->transformationMapping_.resize(1);127 this->transformationWeight_.resize(1);128 129 TransformationIndexMap& transMap = this->transformationMapping_[0];130 TransformationWeightMap& transWeight = this->transformationWeight_[0];131 */132 }133 134 120 135 121 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.hpp
r1988 r1998 5 5 #define __XIOS_DOMAIN_ALGORITHM_REORDER_HPP__ 6 6 7 #include " domain_algorithm_transformation.hpp"7 #include "algorithm_transformation_no_data_modification.hpp" 8 8 #include "transformation.hpp" 9 9 10 namespace xios { 10 namespace xios 11 { 11 12 12 class CDomain;13 class CReorderDomain;13 class CDomain; 14 class CReorderDomain; 14 15 15 /*!16 \class CDomainAlgorithmReorder17 Reordering data on domain18 */19 class CDomainAlgorithmReorder : public CDomainAlgorithmTransformation 20 {21 public:22 CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain);16 /*! 17 \class CDomainAlgorithmReorder 18 Reordering data on domain 19 */ 20 class CDomainAlgorithmReorder : public CAlgorithmTransformationNoDataModification 21 { 22 public: 23 CDomainAlgorithmReorder(bool isSource, CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain); 23 24 24 virtual ~CDomainAlgorithmReorder() {}25 virtual ~CDomainAlgorithmReorder() {} 25 26 26 static bool registerTrans();27 static bool registerTrans(); 27 28 28 protected: 29 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 29 private: 30 30 31 32 private: 33 34 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 35 CTransformation<CDomain>* transformation, 36 int elementPositionInGrid, 37 std::map<int, int>& elementPositionInGridSrc2ScalarPosition, 38 std::map<int, int>& elementPositionInGridSrc2AxisPosition, 39 std::map<int, int>& elementPositionInGridSrc2DomainPosition, 40 std::map<int, int>& elementPositionInGridDst2ScalarPosition, 41 std::map<int, int>& elementPositionInGridDst2AxisPosition, 42 std::map<int, int>& elementPositionInGridDst2DomainPosition); 43 static bool dummyRegistered_; 31 static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc, 32 CTransformation<CDomain>* transformation, 33 int elementPositionInGrid, 34 std::map<int, int>& elementPositionInGridSrc2ScalarPosition, 35 std::map<int, int>& elementPositionInGridSrc2AxisPosition, 36 std::map<int, int>& elementPositionInGridSrc2DomainPosition, 37 std::map<int, int>& elementPositionInGridDst2ScalarPosition, 38 std::map<int, int>& elementPositionInGridDst2AxisPosition, 39 std::map<int, int>& elementPositionInGridDst2DomainPosition); 40 static bool dummyRegistered_; 44 41 }; 45 42 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp
r1988 r1998 38 38 39 39 CDomainAlgorithmZoom::CDomainAlgorithmZoom(bool isSource, CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain) 40 : C DomainAlgorithmTransformation(isSource, domainDestination, domainSource)40 : CAlgorithmTransformationTransfer(isSource), domainSrc_(domainSource), domainDest_(domainDestination) 41 41 TRY 42 42 { … … 175 175 if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 176 176 177 this->transformationMapping_.resize(1);178 this->transformationWeight_.resize(1);179 TransformationIndexMap& transMap = this->transformationMapping_[0];180 TransformationWeightMap& transWeight = this->transformationWeight_[0];181 177 182 178 for (int iDest = 0; iDest < niDest; iDest++) … … 252 248 } 253 249 254 trans Map[indGloDest].push_back(indGloSrc);255 transWeight[indGloDest].push_back(1.0); 250 transformationMapping_[indGloDest]=indGloSrc; 251 256 252 } 257 253 … … 276 272 277 273 domainDestination->checkAttributes() ; 274 278 275 this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ; 279 276 … … 281 278 CATCH 282 279 283 /*! 284 Compute the index mapping between domain on grid source and one on grid destination 285 */ 286 void CDomainAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 287 { 288 } 289 290 291 } 280 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.hpp
r1988 r1998 3 3 #define __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__ 4 4 5 #include " domain_algorithm_transformation.hpp"5 #include "algorithm_transformation_transfer.hpp" 6 6 #include "transformation.hpp" 7 7 … … 15 15 Implementing zoom (alternative zoom) on domain 16 16 */ 17 class CDomainAlgorithmZoom : public C DomainAlgorithmTransformation17 class CDomainAlgorithmZoom : public CAlgorithmTransformationTransfer 18 18 { 19 19 public: … … 25 25 protected: 26 26 void updateDomainAttributes(); 27 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 28 27 29 28 private: 30 29 void updateZoom(); … … 42 41 int zoomNi_; 43 42 int zoomNj_; 43 CDomain* domainSrc_ ; 44 CDomain* domainDest_ ; 44 45 45 46 private: -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp
r1988 r1998 52 52 53 53 public: 54 CGenericAlgorithmTransformation();54 //CGenericAlgorithmTransformation(); 55 55 CGenericAlgorithmTransformation(bool isSource); 56 56 … … 100 100 101 101 protected: 102 virtual void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&) = 0;102 virtual void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&) {}; 103 103 104 104 /*! … … 110 110 virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalElementIndex, 111 111 int elementType, 112 CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc) = 0;112 CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc){}; 113 113 114 114 protected: … … 181 181 public : 182 182 183 v oid computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ;184 v oid apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut);183 virtual void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 184 virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 185 185 186 186 CTransformConnector* transformConnector_ ;
Note: See TracChangeset
for help on using the changeset viewer.