- Timestamp:
- 12/14/20 12:58:39 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
r1988 r1990 1911 1911 std::shared_ptr<CFilter> outputFilter = inputFilter ; 1912 1912 1913 newGrid = CGrid::create() ; // give it an id later ?? 1913 string newId ; 1914 if (gridSrc!=nullptr) newId = gridSrc->getId() + " --> " + this->getId() ; 1915 else newId = " --> " + this->getId() ; 1916 bool isNewGrid ; 1917 if (CGrid::has(newId)) 1918 { 1919 newGrid = CGrid::get(newId); 1920 isNewGrid = false ; 1921 } 1922 else 1923 { 1924 newGrid = CGrid::create(newId) ; // give it an id later ?? 1925 isNewGrid = true ; 1926 } 1927 1914 1928 bool hadTransform=false ; 1915 1929 bool hasTransform=false ; 1930 bool hasRemainTransform=false ; 1916 1931 CGenericAlgorithmTransformation* algo ; 1917 1932 int dimBefore=1 ; … … 1941 1956 hasTransform=transformationPath.hasTransform() ; 1942 1957 1958 if (hasTransform && hadTransform) hasRemainTransform=true ; 1943 1959 1944 1960 if (hasTransform && !hadTransform) … … 1983 1999 dstDomain->setTransformationPaths(transformationPath) ; 1984 2000 } 1985 newGrid->addDomain(dstDomain->getId()) ;2001 if (isNewGrid) newGrid->addDomain(dstDomain->getId()) ; 1986 2002 algo = dstDomain->getTransformationAlgorithm() ; 1987 2003 } … … 2010 2026 dstAxis->setTransformationPaths(transformationPath) ; 2011 2027 } 2012 newGrid->addAxis(dstAxis->getId()) ;2028 if (isNewGrid) newGrid->addAxis(dstAxis->getId()) ; 2013 2029 algo = dstAxis->getTransformationAlgorithm() ; 2014 2030 } … … 2037 2053 dstScalar->setTransformationPaths(transformationPath) ; 2038 2054 } 2039 newGrid->addScalar(dstScalar->getId()) ;2055 if (isNewGrid) newGrid->addScalar(dstScalar->getId()) ; 2040 2056 algo = dstScalar->getTransformationAlgorithm() ; 2041 2057 } … … 2061 2077 if (hadTransform) dimBefore*=domain->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2062 2078 else dimAfter*=domain->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2063 newGrid->addDomain(srcElementId) ;2079 if (isNewGrid) newGrid->addDomain(srcElementId) ; 2064 2080 } 2065 2081 else if (srcElement.type==TYPE_AXIS) … … 2076 2092 if (hadTransform) dimBefore*=axis->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2077 2093 else dimAfter*=axis->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2078 newGrid->addAxis(srcElementId) ;2094 if (isNewGrid) newGrid->addAxis(srcElementId) ; 2079 2095 } 2080 2096 else if (srcElement.type==TYPE_SCALAR) … … 2091 2107 if (hadTransform) dimBefore*=scalar->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2092 2108 else dimAfter*=scalar->getLocalView(CElementView::WORKFLOW)->getLocalSize() ; 2093 newGrid->addScalar(srcElementId) ;2109 if (isNewGrid) newGrid->addScalar(srcElementId) ; 2094 2110 } 2095 2111 } … … 2105 2121 } 2106 2122 2107 gridSrc=newGrid ; 2108 pair<shared_ptr<CFilter>, shared_ptr<CFilter> > filters = gridSrc->buildTransformationGraph(gc, isSource, gridSrc, detectMissingValues, defaultValue, newGrid) ; 2109 outputFilter->connectOutput(filters.first,0) ; 2110 outputFilter=filters.second ; 2123 if (hasRemainTransform) 2124 { 2125 gridSrc=newGrid ; 2126 pair<shared_ptr<CFilter>, shared_ptr<CFilter> > filters = gridSrc->buildTransformationGraph(gc, isSource, gridSrc, detectMissingValues, defaultValue, newGrid) ; 2127 outputFilter->connectOutput(filters.first,0) ; 2128 outputFilter=filters.second ; 2129 } 2111 2130 } 2112 2131
Note: See TracChangeset
for help on using the changeset viewer.