Changeset 1106 for XIOS/trunk
- Timestamp:
- 04/25/17 10:57:55 (7 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r1050 r1106 977 977 } 978 978 979 /*! 980 Compare two axis objects. 981 They are equal if only if they have identical attributes as well as their values. 982 Moreover, they must have the same transformations. 983 \param [in] axis Compared axis 984 \return result of the comparison 985 */ 986 bool CAxis::isEqual(CAxis* obj) 987 { 988 bool objEqual = SuperClass::isEqual(obj); 989 if (!objEqual) return objEqual; 990 991 TransMapTypes thisTrans = this->getAllTransformations(); 992 TransMapTypes objTrans = obj->getAllTransformations(); 993 994 TransMapTypes::const_iterator it, itb, ite; 995 std::vector<ETranformationType> thisTransType, objTransType; 996 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 997 thisTransType.push_back(it->first); 998 for (it = objTrans.begin(); it != objTrans.end(); ++it) 999 objTransType.push_back(it->first); 1000 1001 if (thisTransType.size() != objTransType.size()) return false; 1002 for (int idx = 0; idx < thisTransType.size(); ++idx) 1003 objEqual &= (thisTransType[idx] == objTransType[idx]); 1004 1005 return objEqual; 1006 } 1007 979 1008 CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 980 1009 { … … 996 1025 { 997 1026 return transformationMap_; 998 }999 1000 /*!1001 Check the validity of all transformations applied on axis1002 This functions is called AFTER all inherited attributes are solved1003 */1004 void CAxis::checkTransformations()1005 {1006 TransMapTypes::const_iterator itb = transformationMap_.begin(), it,1007 ite = transformationMap_.end();1008 // for (it = itb; it != ite; ++it)1009 // {1010 // (it->second)->checkValid(this);1011 // }1012 1027 } 1013 1028 -
XIOS/trunk/src/node/axis.hpp
r1050 r1106 117 117 void duplicateTransformation(CAxis*); 118 118 CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id=""); 119 bool isEqual(CAxis* axis); 119 120 120 121 public: … … 131 132 void checkZoom(); 132 133 void checkBounds(); 133 void checkLabel(); 134 void checkTransformations(); 134 void checkLabel(); 135 135 void sendValue(); 136 136 void computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid, -
XIOS/trunk/src/node/domain.cpp
r1078 r1106 2238 2238 } 2239 2239 2240 /*! 2241 Compare two domain objects. 2242 They are equal if only if they have identical attributes as well as their values. 2243 Moreover, they must have the same transformations. 2244 \param [in] domain Compared domain 2245 \return result of the comparison 2246 */ 2247 bool CDomain::isEqual(CDomain* obj) 2248 { 2249 bool objEqual = SuperClass::isEqual(obj); 2250 if (!objEqual) return objEqual; 2251 2252 TransMapTypes thisTrans = this->getAllTransformations(); 2253 TransMapTypes objTrans = obj->getAllTransformations(); 2254 2255 TransMapTypes::const_iterator it, itb, ite; 2256 std::vector<ETranformationType> thisTransType, objTransType; 2257 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 2258 thisTransType.push_back(it->first); 2259 for (it = objTrans.begin(); it != objTrans.end(); ++it) 2260 objTransType.push_back(it->first); 2261 2262 if (thisTransType.size() != objTransType.size()) return false; 2263 for (int idx = 0; idx < thisTransType.size(); ++idx) 2264 objEqual &= (thisTransType[idx] == objTransType[idx]); 2265 2266 return objEqual; 2267 } 2268 2240 2269 CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 2241 2270 { … … 2269 2298 { 2270 2299 return transformationMap_; 2271 }2272 2273 /*!2274 Check the validity of all transformations applied on domain2275 This functions is called AFTER all inherited attributes are solved2276 */2277 void CDomain::checkTransformations()2278 {2279 TransMapTypes::const_iterator itb = transformationMap_.begin(), it,2280 ite = transformationMap_.end();2281 // for (it = itb; it != ite; ++it)2282 // {2283 // (it->second)->checkValid(this);2284 // }2285 2300 } 2286 2301 -
XIOS/trunk/src/node/domain.hpp
r1078 r1106 124 124 125 125 std::vector<int> getNbGlob(); 126 bool isEqual(CDomain* domain); 126 127 public: 127 128 /// Mutateur /// … … 132 133 void sendLonLatArea(void); 133 134 void computeConnectedServer(void) ; 134 135 void computeLocalMask(void) ; 136 135 137 void AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 136 138 CArray<double,1>& lon_g, CArray<double,1>& lat_g); … … 181 183 void checkArea(void); 182 184 void checkLonLat(); 183 void checkZoom(void); 184 void computeLocalMask(void) ; 185 186 void checkTransformations(); 185 void checkZoom(void); 186 187 187 void setTransformations(const TransMapTypes&); 188 188 void computeNGlobDomain(); -
XIOS/trunk/src/node/scalar.cpp
r976 r1106 65 65 } 66 66 67 /*! 68 Compare two scalar objects. 69 They are equal if only if they have identical attributes as well as their values. 70 Moreover, they must have the same transformations. 71 \param [in] scalar Compared scalar 72 \return result of the comparison 73 */ 74 bool CScalar::isEqual(CScalar* obj) 75 { 76 bool objEqual = SuperClass::isEqual(obj); 77 if (!objEqual) return objEqual; 78 79 TransMapTypes thisTrans = this->getAllTransformations(); 80 TransMapTypes objTrans = obj->getAllTransformations(); 81 82 TransMapTypes::const_iterator it, itb, ite; 83 std::vector<ETranformationType> thisTransType, objTransType; 84 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 85 thisTransType.push_back(it->first); 86 for (it = objTrans.begin(); it != objTrans.end(); ++it) 87 objTransType.push_back(it->first); 88 89 if (thisTransType.size() != objTransType.size()) return false; 90 for (int idx = 0; idx < thisTransType.size(); ++idx) 91 objEqual &= (thisTransType[idx] == objTransType[idx]); 92 93 return objEqual; 94 } 95 67 96 CTransformation<CScalar>* CScalar::addTransformation(ETranformationType transType, const StdString& id) 68 97 { … … 84 113 { 85 114 return transformationMap_; 86 }87 88 /*!89 Check the validity of all transformations applied on scalar90 This functions is called AFTER all inherited attributes are solved91 */92 void CScalar::checkTransformations()93 {94 TransMapTypes::const_iterator itb = transformationMap_.begin(), it,95 ite = transformationMap_.end();96 // for (it = itb; it != ite; ++it)97 // {98 // (it->second)->checkValid(this);99 // }100 115 } 101 116 -
XIOS/trunk/src/node/scalar.hpp
r888 r1106 76 76 void duplicateTransformation(CScalar*); 77 77 CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id=""); 78 bool isEqual(CScalar* scalar); 78 79 79 80 private: 80 81 std::set<StdString> relFiles; 82 TransMapTypes transformationMap_; 81 83 82 private: 83 TransMapTypes transformationMap_; 84 void checkTransformations(); 84 private: 85 85 void setTransformations(const TransMapTypes&); 86 86 -
XIOS/trunk/src/transformation/grid_transformation_selector.cpp
r980 r1106 202 202 203 203 // If source and destination grid share the same scalar 204 if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && 205 (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) && !isSameGrid_) return; 204 if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && !isSameGrid_ && 205 ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) || 206 (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return; 206 207 207 208 if (scalarListDestP[scalarDstPos]->hasTransformation()) … … 242 243 243 244 // If source and destination grid share the same axis 244 if ((-1 != axisDstPos) && (-1 != axisSrcPos) && 245 (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) && !isSameGrid_) return; 245 if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ && 246 ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) || 247 (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return; 246 248 247 249 if (axisListDestP[axisDstPos]->hasTransformation()) … … 281 283 282 284 // If source and destination grid share the same domain 283 if ((-1 != domDstPos) && (-1 != domSrcPos) && 284 (domListDestP[domDstPos] == domListSrcP[domSrcPos]) && !isSameGrid_) return; 285 if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ && 286 ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) || 287 (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return; 285 288 286 289 if (domListDestP[domDstPos]->hasTransformation())
Note: See TracChangeset
for help on using the changeset viewer.