Changeset 775 for XIOS/trunk/src/node/grid.cpp
- Timestamp:
- 11/02/15 11:46:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/grid.cpp
r771 r775 31 31 , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 32 32 , transformations_(0), isTransformed_(false) 33 , axisPositionInGrid_(), positionDimensionDistributed_(1) 33 , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 34 34 { 35 35 setVirtualDomainGroup(); … … 45 45 , globalDim_(), connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 46 46 , transformations_(0), isTransformed_(false) 47 , axisPositionInGrid_(), positionDimensionDistributed_(1) 47 , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 48 48 { 49 49 setVirtualDomainGroup(); … … 203 203 computeGridGlobalDimension(getDomains(), getAxis(), axis_domain_order); 204 204 this->isDomainAxisChecked = areAttributesChecked; 205 } 206 207 void CGrid::solveDomainAxisBaseRef() 208 { 209 if (this->hasDomainAxisBaseRef_) return; 210 // Account for the axis attributes 211 std::vector<CAxis*> axisList = getAxis(); 212 for (size_t i = 0; i < axisList.size(); ++i) 213 { 214 axisList[i]->solveBaseReference(); 215 axisList[i]->setAttributesBaseReference(); 216 } 217 218 // Account for the domain attributes 219 std::vector<CDomain*> domList = getDomains(); 220 for (size_t i = 0; i < domList.size(); ++i) 221 { 222 domList[i]->solveBaseReference(); 223 domList[i]->setAttributesBaseReference(); 224 } 225 this->hasDomainAxisBaseRef_ = true; 205 226 } 206 227 … … 1260 1281 void CGrid::completeGrid(CGrid* transformGridSrc) 1261 1282 { 1262 if (!transformGridSrc) 1263 ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 1264 << "Impossible to complete grid '" << getId() << "', the source grid is null."); 1265 1266 if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 1267 { 1268 ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 1269 << "Two grids have different dimension size" 1270 << "Dimension of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 1271 << "Dimension of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 1272 } 1273 else 1274 { 1275 int ssize = axis_domain_order.numElements(); 1276 for (int i = 0; i < ssize; ++i) 1277 if (axis_domain_order(i) != (transformGridSrc->axis_domain_order)(i)) 1278 ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 1279 << "Grids " << this->getId() << " and " << transformGridSrc->getId() 1280 << " don't have elements in the same order"); 1283 if (0 != transformGridSrc) 1284 { 1285 if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 1286 { 1287 ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 1288 << "Two grids have different dimension size" 1289 << "Dimension of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 1290 << "Dimension of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 1291 } 1292 else 1293 { 1294 int ssize = axis_domain_order.numElements(); 1295 for (int i = 0; i < ssize; ++i) 1296 if (axis_domain_order(i) != (transformGridSrc->axis_domain_order)(i)) 1297 ERROR("CGrid::completeGrid(CGrid* transformGridSrc)", 1298 << "Grids " << this->getId() << " and " << transformGridSrc->getId() 1299 << " don't have elements in the same order"); 1300 } 1281 1301 } 1282 1302
Note: See TracChangeset
for help on using the changeset viewer.