Changeset 1999 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Timestamp:
- 01/03/21 18:00:43 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src/node
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r1988 r1999 850 850 CGrid* newGrid ; 851 851 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = grid_->buildTransformationGraph(gc, true, nullptr, detectMissingValues, defaultValue, newGrid) ; 852 newGrid->duplicateAttributes(grid_) ; // for grid attributes (mask) 852 853 grid_ = newGrid ; 853 854 grid_ref=grid_->getId() ; // for server -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
r1994 r1999 27 27 #include "grid_transformation_factory_impl.hpp" 28 28 #include "transform_filter.hpp" 29 #include "grid_algorithm.hpp" 29 30 30 31 … … 241 242 for (int idx = 0; idx < order_.size(); ++idx) axis_domain_order(idx)=order_[idx]; 242 243 CDomain* domain = vDomainGroup_->createChild(id); 244 isDomListSet=false ; 243 245 computeElements(); 244 246 return domain ; … … 253 255 for (int idx = 0; idx < order_.size(); ++idx) axis_domain_order(idx)=order_[idx]; 254 256 CAxis* axis=vAxisGroup_->createChild(id); 257 isAxisListSet=false ; 255 258 computeElements(); 256 259 return axis ; … … 265 268 for (int idx = 0; idx < order_.size(); ++idx) axis_domain_order(idx)=order_[idx]; 266 269 CScalar* scalar = vScalarGroup_->createChild(id); 270 isScalarListSet=false ; 267 271 computeElements(); 268 272 return scalar; … … 1922 1926 else 1923 1927 { 1924 newGrid = CGrid::create(newId) ; // give it an id later ??1928 newGrid = CGrid::create(newId) ; 1925 1929 isNewGrid = true ; 1926 1930 } … … 1930 1934 bool hasRemainTransform=false ; 1931 1935 CGenericAlgorithmTransformation* algo ; 1932 int dimBefore=1 ; 1933 int dimAfter=1 ; 1936 int pos ; 1934 1937 1935 1938 for(int i=0 ; i<elements_.size(); i++) … … 1958 1961 if (hasTransform && !hadTransform) 1959 1962 { 1963 pos=i ; 1960 1964 EElement dstElementType=transformationPath.getNextElementType() ; 1961 1965 string dstElementId=transformationPath.getNextElementId() ; … … 2075 2079 domain->checkAttributes() ; 2076 2080 2077 if (hadTransform) dimBefore*=domain->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2078 else dimAfter*=domain->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2079 2081 if (isNewGrid) newGrid->addDomain(srcElementId) ; 2080 2082 } … … 2091 2093 axis->checkAttributes() ; 2092 2094 2093 if (hadTransform) dimBefore*=axis->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2094 else dimAfter*=axis->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2095 2095 if (isNewGrid) newGrid->addAxis(srcElementId) ; 2096 2096 } … … 2107 2107 scalar->checkAttributes() ; 2108 2108 2109 if (hadTransform) dimBefore*=scalar->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2110 else dimAfter*=scalar->getLocalView(CElementView::WORKFLOW)->getLocalSize() ;2111 2109 if (isNewGrid) newGrid->addScalar(srcElementId) ; 2112 2110 } … … 2121 2119 if (!isSource) 2122 2120 { 2123 shared_ptr<CTransformFilter> transformFilter = shared_ptr<CTransformFilter>(new CTransformFilter(gc, algo, dimBefore, dimAfter, detectMissingValues, defaultValue)) ; 2121 CGridAlgorithm* gridAlgorithm ; 2122 if (isNewGrid) 2123 { 2124 gridAlgorithm = algo->createGridAlgorithm(gridSrc, newGrid, pos) ; 2125 newGrid->setGridAlgorithm(gridAlgorithm); 2126 } 2127 else gridAlgorithm = newGrid->getGridAlgorithm() ; 2128 2129 shared_ptr<CTransformFilter> transformFilter = shared_ptr<CTransformFilter>(new CTransformFilter(gc, gridAlgorithm, detectMissingValues, defaultValue)) ; 2124 2130 outputFilter->connectOutput(transformFilter,0) ; 2125 2131 outputFilter = transformFilter ; … … 2129 2135 { 2130 2136 gridSrc=newGrid ; 2131 pair<shared_ptr<CFilter>, shared_ptr<CFilter> > filters = gridSrc->buildTransformationGraph(gc, isSource, gridSrc, detectMissingValues, defaultValue, newGrid) ;2137 pair<shared_ptr<CFilter>, shared_ptr<CFilter> > filters = this->buildTransformationGraph(gc, isSource, gridSrc, detectMissingValues, defaultValue, newGrid) ; 2132 2138 outputFilter->connectOutput(filters.first,0) ; 2133 2139 outputFilter=filters.second ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
r1988 r1999 22 22 #include "transformation_path.hpp" 23 23 #include "filter.hpp" 24 #include "grid_algorithm.hpp" 24 25 25 26 … … 239 240 double defaultValue, CGrid*& newGrid) ; 240 241 private: 242 CGridAlgorithm* gridAlgorithm_ = nullptr ; 243 public: 244 void setGridAlgorithm(CGridAlgorithm* gridAlgorithm) {gridAlgorithm_ = gridAlgorithm;} 245 CGridAlgorithm* getGridAlgorithm(void) { return gridAlgorithm_ ;} 246 private: 241 247 bool isTransformed_, isGenerated_; 242 248 CGridTransformation* transformations_;
Note: See TracChangeset
for help on using the changeset viewer.