Changeset 1984 for XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation
- Timestamp:
- 12/06/20 22:14:56 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation
- Files:
-
- 9 added
- 46 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp
r1784 r1984 14 14 #include "timer.hpp" 15 15 #include "mpi.hpp" 16 17 namespace xios { 16 #include "transform_connector.hpp" 17 #include "weight_transform_connector.hpp" 18 19 namespace xios 20 { 18 21 19 22 CGenericAlgorithmTransformation::CGenericAlgorithmTransformation() … … 1135 1138 CATCH 1136 1139 1137 } 1140 1141 /////////////////////////////////////////////////////////////// 1142 ////////// new algorithm for new method ///////// 1143 /////////////////////////////////////////////////////////////// 1144 1145 1146 1147 void CGenericAlgorithmTransformation::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) 1148 { 1149 auto& srcMap = transformationMapping_[0] ; 1150 set<size_t> srcIndex ; 1151 for(auto& it : srcMap) 1152 for(size_t index : it.second) srcIndex.insert(index) ; 1153 1154 CArray<size_t,1> srcArrayIndex(srcIndex.size()) ; 1155 int i=0 ; 1156 for(size_t index : srcIndex) { srcArrayIndex(i) = index ; i++ ;} 1157 CLocalElement recvElement(CContext::getCurrent()->getIntraCommRank(), srcView->getGlobalSize(), srcArrayIndex) ; 1158 recvElement.addFullView() ; 1159 1160 transformConnector_ = new CTransformConnector(srcView, recvElement.getView(CElementView::FULL), CContext::getCurrent()->getIntraComm()) ; 1161 transformConnector_->computeConnector() ; 1162 weightTransformConnector_ = new CWeightTransformConnector( recvElement.getView(CElementView::FULL), dstView, transformationMapping_[0], transformationWeight_[0]) ; 1163 } 1164 1165 1166 void CGenericAlgorithmTransformation::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) 1167 { 1168 CArray<double,1> dataOutTmp ; 1169 transformConnector_->transfer(dimBefore, dimAfter, dataIn, dataOutTmp) ; 1170 weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataOutTmp, dataOut) ; 1171 } 1172 1173 1174 1175 1176 1177 1178 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp
r1637 r1984 14 14 #include "array_new.hpp" 15 15 #include "client_client_dht_template.hpp" 16 #include "local_view.hpp" 17 #include "transform_connector.hpp" 18 #include "weight_transform_connector.hpp" 16 19 17 namespace xios { 20 namespace xios 21 { 18 22 class CGrid; 19 23 class CDomain; … … 169 173 bool eliminateRedondantSrc_ ; // flag to indicate if the transformation must select only one global source point for all proc. 170 174 // In this case it will choose preferentially the current process 175 176 177 // new methods for new algorithm 178 179 public : 180 181 void computeAlgorithm(CLocalView* srcView, CLocalView* dstView) ; 182 void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); 183 184 CTransformConnector* transformConnector_ ; 185 CWeightTransformConnector* weightTransformConnector_ ; 186 171 187 }; 172 188
Note: See TracChangeset
for help on using the changeset viewer.