Changeset 1646 for XIOS/dev/dev_trunk_omp/src/node/grid.cpp
- Timestamp:
- 01/31/19 12:12:52 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/node/grid.cpp
r1562 r1646 82 82 83 83 StdSize CGrid::getDimension(void) 84 TRY 84 85 { 85 86 return getGlobalDimension().size(); 86 87 } 88 CATCH_DUMP_ATTR 87 89 88 90 //--------------------------------------------------------------- 89 91 90 92 StdSize CGrid::getDataSize(void) const 93 TRY 91 94 { 92 95 StdSize retvalue = 1; … … 98 101 return retvalue; 99 102 } 103 CATCH 100 104 101 105 /*! … … 106 110 */ 107 111 std::map<int, StdSize> CGrid::getAttributesBufferSize(CContextClient* client, bool bufferForWriting) 112 TRY 108 113 { 109 114 std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client); … … 147 152 return attributesSizes; 148 153 } 154 CATCH_DUMP_ATTR 149 155 150 156 /*! … … 156 162 */ 157 163 std::map<int, StdSize> CGrid::getDataBufferSize(CContextClient* client, const std::string& id /*= ""*/, bool bufferForWriting /*= "false"*/) 164 TRY 158 165 { 159 166 // The record index is sometimes sent along with the data but we always … … 180 187 return dataSizes; 181 188 } 189 CATCH_DUMP_ATTR 182 190 183 191 size_t CGrid::getGlobalWrittenSize(void) 192 TRY 184 193 { 185 194 std::vector<CDomain*> domainP = this->getDomains(); … … 191 200 return globalGridSize ; 192 201 } 193 202 CATCH_DUMP_ATTR 194 203 195 204 void CGrid::checkAttributesAfterTransformation() 205 TRY 196 206 { 197 207 setAxisList(); … … 228 238 } 229 239 } 240 CATCH_DUMP_ATTR 230 241 231 242 //--------------------------------------------------------------- … … 237 248 */ 238 249 bool CGrid::isCompressible(void) const 250 TRY 239 251 { 240 252 return isCompressible_; 241 253 } 254 CATCH 242 255 243 256 //--------------------------------------------------------------- 244 257 245 258 void CGrid::addRelFileCompressed(const StdString& filename) 259 TRY 246 260 { 247 261 this->relFilesCompressed.insert(filename); 248 262 } 263 CATCH_DUMP_ATTR 249 264 250 265 bool CGrid::isWrittenCompressed(const StdString& filename) const 266 TRY 251 267 { 252 268 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 253 269 } 270 CATCH 254 271 255 272 //--------------------------------------------------------------- … … 258 275 */ 259 276 void CGrid::solveDomainAxisRef(bool areAttributesChecked) 277 TRY 260 278 { 261 279 if (this->isDomainAxisChecked) return; … … 266 284 this->isDomainAxisChecked = areAttributesChecked; 267 285 } 286 CATCH_DUMP_ATTR 268 287 269 288 /* … … 272 291 */ 273 292 void CGrid::solveDomainAxisBaseRef() 293 TRY 274 294 { 275 295 if (this->hasDomainAxisBaseRef_) return; … … 297 317 this->hasDomainAxisBaseRef_ = true; 298 318 } 319 CATCH_DUMP_ATTR 299 320 300 321 void CGrid::checkEligibilityForCompressedOutput() 322 TRY 301 323 { 302 324 // We don't check if the mask is valid here, just if a mask has been defined at this point. 303 325 isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty(); 304 326 } 327 CATCH_DUMP_ATTR 305 328 306 329 void CGrid::checkMaskIndex(bool doSendingIndex) 330 TRY 307 331 { 308 332 CContext* context = CContext::getCurrent(); … … 339 363 this->isChecked = true; 340 364 } 365 CATCH_DUMP_ATTR 366 bool CGrid::hasMask() const 367 TRY 368 { 369 return (!mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty() || 370 !mask_4d.isEmpty() || !mask_5d.isEmpty() || !mask_6d.isEmpty() || !mask_7d.isEmpty()); 371 } 372 CATCH 341 373 342 374 /* … … 344 376 */ 345 377 void CGrid::createMask(void) 378 TRY 346 379 { 347 380 using namespace std; … … 381 414 } 382 415 } 416 CATCH_DUMP_ATTR 383 417 384 418 /* … … 386 420 */ 387 421 void CGrid::checkMask(void) 422 TRY 388 423 { 389 424 using namespace std; … … 423 458 } 424 459 } 425 426 427 /*! 428 A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 429 It's not a good idea to store all multi-dimension arrays corresponding to each mask. 430 One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 431 \param [in] multi-dimension array grid mask 432 */ 433 434 void CGrid::getLocalMask(CArray<bool,1>& localMask) 435 { 436 std::vector<CDomain*> domainP = this->getDomains(); 437 std::vector<CAxis*> axisP = this->getAxis(); 438 int dim = domainP.size() * 2 + axisP.size(); 439 440 switch (dim) 441 { 442 case 0: 443 getLocalMask(mask_0d, localMask); 444 break; 445 case 1: 446 getLocalMask(mask_1d, localMask); 447 break; 448 case 2: 449 getLocalMask(mask_2d, localMask); 450 break; 451 case 3: 452 getLocalMask(mask_3d, localMask); 453 break; 454 case 4: 455 getLocalMask(mask_4d, localMask); 456 break; 457 case 5: 458 getLocalMask(mask_5d, localMask); 459 break; 460 case 6: 461 getLocalMask(mask_6d, localMask); 462 break; 463 case 7: 464 getLocalMask(mask_7d, localMask); 465 break; 466 default: 467 break; 468 } 469 } 470 460 CATCH_DUMP_ATTR 461 471 462 /* 472 463 Modify value of mask in a certain index … … 476 467 */ 477 468 void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue) 469 TRY 478 470 { 479 471 using namespace std; … … 511 503 } 512 504 } 505 CATCH_DUMP_ATTR 513 506 514 507 /* … … 518 511 */ 519 512 void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue) 513 TRY 520 514 { 521 515 std::vector<CDomain*> domainP = this->getDomains(); … … 552 546 } 553 547 } 548 CATCH_DUMP_ATTR 554 549 555 550 //--------------------------------------------------------------- 556 551 557 552 void CGrid::solveDomainRef(bool sendAtt) 553 TRY 558 554 { 559 555 setDomainList(); … … 568 564 } 569 565 } 566 CATCH_DUMP_ATTR 570 567 571 568 //--------------------------------------------------------------- 572 569 573 570 void CGrid::solveAxisRef(bool sendAtt) 571 TRY 574 572 { 575 573 setAxisList(); … … 599 597 } 600 598 } 599 CATCH_DUMP_ATTR 601 600 602 601 //--------------------------------------------------------------- 603 602 604 603 void CGrid::solveScalarRef(bool sendAtt) 604 TRY 605 605 { 606 606 setScalarList(); … … 616 616 } 617 617 } 618 CATCH_DUMP_ATTR 618 619 619 620 /*! … … 621 622 */ 622 623 void CGrid::computeWrittenIndex() 624 TRY 623 625 { 624 626 if (computedWrittenIndex_) return; … … 680 682 } 681 683 } 684 CATCH_DUMP_ATTR 682 685 683 686 //--------------------------------------------------------------- … … 690 693 */ 691 694 void CGrid::computeClientIndex() 695 TRY 692 696 { 693 697 CContext* context = CContext::getCurrent(); … … 698 702 clientDistribution_ = new CDistributionClient(rank, this); 699 703 // Get local data index on client 700 storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size()); 701 int nbStoreIndex = storeIndex_client.numElements(); 704 int nbStoreIndex = clientDistribution_->getLocalDataIndexOnClient().size(); 705 int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size(); 706 // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise 707 storeIndex_client.resize(nbStoreIndex); 708 storeMask_client.resize(nbStoreGridMask); 702 709 for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 710 for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 703 711 704 712 if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed(); … … 746 754 } 747 755 } 756 CATCH_DUMP_ATTR 748 757 749 758 /*! … … 751 760 */ 752 761 void CGrid::computeConnectedClients() 762 TRY 753 763 { 754 764 CContext* context = CContext::getCurrent(); … … 840 850 connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize); 841 851 852 // Now check if all servers have data to receive. If not, master client will send empty data. 853 // This ensures that all servers will participate in collective calls upon receiving even if they have no date to receive. 854 std::vector<int> counts (client->clientSize); 855 std::vector<int> displs (client->clientSize); 856 displs[0] = 0; 857 int localCount = connectedServerRank_[receiverSize].size() ; 858 ep_lib::MPI_Gather(&localCount, 1, MPI_INT, &counts[0], 1, MPI_INT, 0, client->intraComm) ; 859 860 for (int i = 0; i < client->clientSize-1; ++i) 861 { 862 displs[i+1] = displs[i] + counts[i]; 863 } 864 std::vector<int> allConnectedServers(displs[client->clientSize-1]+counts[client->clientSize-1]); 865 866 ep_lib::MPI_Gatherv(&(connectedServerRank_[receiverSize])[0], localCount, MPI_INT, &allConnectedServers[0], &counts[0], &displs[0], MPI_INT, 0, client->intraComm); 867 868 869 if ((allConnectedServers.size() != receiverSize) && (client->clientRank == 0)) 870 { 871 std::vector<bool> isSrvConnected (receiverSize, false); 872 for (int i = 0; i < allConnectedServers.size(); ++i) isSrvConnected[allConnectedServers[i]] = true; 873 for (int i = 0; i < receiverSize; ++i) 874 { 875 if (!isSrvConnected[i]) connectedServerRank_[receiverSize].push_back(i); 876 } 877 } 878 842 879 nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]); 843 880 } 844 881 } 845 882 } 883 CATCH_DUMP_ATTR 846 884 847 885 /*! … … 853 891 */ 854 892 void CGrid::computeIndex(void) 893 TRY 855 894 { 856 895 CContext* context = CContext::getCurrent(); … … 879 918 } 880 919 } 920 CATCH_DUMP_ATTR 881 921 882 922 /*! … … 892 932 const CContextClient* client, 893 933 CClientServerMapping::GlobalIndexMap& globalIndexOnServer) 934 TRY 894 935 { 895 936 int serverSize = client->serverSize; … … 1058 1099 } 1059 1100 } 1060 //---------------------------------------------------------------- 1101 CATCH_DUMP_ATTR 1102 //---------------------------------------------------------------- 1061 1103 1062 1104 CGrid* CGrid::createGrid(CDomain* domain) 1105 TRY 1063 1106 { 1064 1107 std::vector<CDomain*> vecDom(1, domain); … … 1067 1110 return createGrid(vecDom, vecAxis); 1068 1111 } 1112 CATCH 1069 1113 1070 1114 CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis) 1071 { 1115 TRY 1116 { 1072 1117 std::vector<CDomain*> vecDom(1, domain); 1073 1118 std::vector<CAxis*> vecAxis(1, axis); … … 1075 1120 return createGrid(vecDom, vecAxis); 1076 1121 } 1122 CATCH 1077 1123 1078 1124 CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 1079 1125 const CArray<int,1>& axisDomainOrder) 1126 TRY 1080 1127 { 1081 1128 std::vector<CScalar*> vecScalar; 1082 1129 return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder); 1083 1130 } 1131 CATCH 1084 1132 1085 1133 CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 1086 1134 const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 1135 TRY 1087 1136 { 1088 1137 return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder); 1089 1138 } 1139 CATCH 1090 1140 1091 1141 CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 1092 1142 const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 1143 TRY 1093 1144 { 1094 1145 if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) … … 1132 1183 return grid; 1133 1184 } 1185 CATCH 1134 1186 1135 1187 CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc) 1188 TRY 1136 1189 { 1137 1190 std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc; … … 1173 1226 return grid; 1174 1227 } 1228 CATCH 1175 1229 1176 1230 StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 1177 1231 const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 1232 TRY 1178 1233 { 1179 1234 if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size())) … … 1216 1271 return id.str(); 1217 1272 } 1273 CATCH 1218 1274 1219 1275 StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest) 1276 TRY 1220 1277 { 1221 1278 StdString idSrc = gridSrc->getId(); … … 1227 1284 return id.str(); 1228 1285 } 1286 CATCH 1229 1287 1230 1288 //---------------------------------------------------------------- 1231 1289 1232 1290 CDomainGroup* CGrid::getVirtualDomainGroup() const 1291 TRY 1233 1292 { 1234 1293 return this->vDomainGroup_; 1235 1294 } 1295 CATCH 1236 1296 1237 1297 CAxisGroup* CGrid::getVirtualAxisGroup() const 1298 TRY 1238 1299 { 1239 1300 return this->vAxisGroup_; 1240 1301 } 1302 CATCH 1241 1303 1242 1304 CScalarGroup* CGrid::getVirtualScalarGroup() const 1305 TRY 1243 1306 { 1244 1307 return this->vScalarGroup_; 1245 1308 } 1309 CATCH 1246 1310 1247 1311 /* … … 1279 1343 1280 1344 void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 1345 TRY 1281 1346 { 1282 1347 const StdSize size = storeIndex_client.numElements(); … … 1285 1350 for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 1286 1351 } 1352 CATCH 1287 1353 1288 1354 void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const 1355 TRY 1289 1356 { 1290 1357 const StdSize size = storeIndex_client.numElements(); … … 1292 1359 for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 1293 1360 } 1361 CATCH 1362 1363 void CGrid::maskField_arr(const double* const data, CArray<double, 1>& stored) const 1364 { 1365 const StdSize size = storeIndex_client.numElements(); 1366 stored.resize(size); 1367 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 1368 1369 if (storeMask_client.numElements() != 0) 1370 for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 1371 else 1372 for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 1373 } 1294 1374 1295 1375 void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const 1376 TRY 1296 1377 { 1297 1378 const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient(); … … 1299 1380 for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i]; 1300 1381 } 1301 1382 CATCH 1302 1383 1303 1384 void CGrid::computeClientIndexScalarGrid() 1385 TRY 1304 1386 { 1305 1387 CContext* context = CContext::getCurrent(); … … 1335 1417 } 1336 1418 } 1419 CATCH_DUMP_ATTR 1337 1420 1338 1421 void CGrid::computeConnectedClientsScalarGrid() 1422 TRY 1339 1423 { 1340 1424 CContext* context = CContext::getCurrent(); … … 1381 1465 } 1382 1466 } 1467 CATCH_DUMP_ATTR 1383 1468 1384 1469 void CGrid::sendIndexScalarGrid() 1470 TRY 1385 1471 { 1386 1472 CContext* context = CContext::getCurrent(); … … 1446 1532 } 1447 1533 } 1534 CATCH_DUMP_ATTR 1448 1535 1449 1536 void CGrid::sendIndex(void) 1537 TRY 1450 1538 { 1451 1539 CContext* context = CContext::getCurrent(); … … 1567 1655 } 1568 1656 } 1657 CATCH_DUMP_ATTR 1569 1658 1570 1659 void CGrid::recvIndex(CEventServer& event) 1660 TRY 1571 1661 { 1572 1662 string gridId; … … 1584 1674 get(gridId)->recvIndex(ranks, buffers); 1585 1675 } 1676 CATCH 1586 1677 1587 1678 void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers) 1679 TRY 1588 1680 { 1589 1681 CContext* context = CContext::getCurrent(); … … 1748 1840 nGlob.push_back(1); 1749 1841 } 1750 1751 modifyMaskSize(nSize, false);1752 1753 // These below codes are reserved for future1754 CDistributionServer srvDist(server->intraCommRank, nBegin, nSize, nBeginGlobal, nGlob);1755 map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),1756 ite = outGlobalIndexFromClient.end(), it;1757 const CDistributionServer::GlobalLocalMap& globalLocalMask = srvDist.getGlobalLocalIndex();1758 CDistributionServer::GlobalLocalMap::const_iterator itSrv;1759 size_t nb = 0;1760 for (it = itb; it != ite; ++it)1761 {1762 CArray<size_t,1>& globalInd = it->second;1763 for (size_t idx = 0; idx < globalInd.numElements(); ++idx)1764 {1765 if (globalLocalMask.end() != globalLocalMask.find(globalInd(idx))) ++nb;1766 }1767 }1768 1769 CArray<int,1> indexToModify(nb);1770 nb = 0;1771 for (it = itb; it != ite; ++it)1772 {1773 CArray<size_t,1>& globalInd = it->second;1774 for (size_t idx = 0; idx < globalInd.numElements(); ++idx)1775 {1776 itSrv = globalLocalMask.find(globalInd(idx));1777 if (globalLocalMask.end() != itSrv)1778 {1779 indexToModify(nb) = itSrv->second;1780 ++nb;1781 }1782 }1783 }1784 1785 modifyMask(indexToModify, true);1786 1842 } 1787 1843 … … 1791 1847 } 1792 1848 } 1849 CATCH_DUMP_ATTR 1793 1850 1794 1851 /* … … 1806 1863 const std::vector<CScalar*> scalars, 1807 1864 const CArray<int,1>& axisDomainOrder) 1808 { 1865 TRY 1866 { 1809 1867 // globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 1810 1868 globalDim.resize(domains.size()*2+axis.size()); … … 1846 1904 return positionDimensionDistributed; 1847 1905 } 1906 CATCH_DUMP_ATTR 1848 1907 1849 1908 // Retrieve the global dimension of grid 1850 1909 std::vector<int> CGrid::getGlobalDimension() 1910 TRY 1851 1911 { 1852 1912 std::vector<int> globalDim; … … 1855 1915 return globalDim; 1856 1916 } 1917 CATCH_DUMP_ATTR 1857 1918 1858 1919 // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 1859 1920 int CGrid::getDistributedDimension() 1921 TRY 1860 1922 { 1861 1923 std::vector<int> globalDim; 1862 1924 return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1863 1925 } 1926 CATCH_DUMP_ATTR 1864 1927 1865 1928 bool CGrid::isScalarGrid() const 1929 TRY 1866 1930 { 1867 1931 return (axisList_.empty() && domList_.empty()); 1868 1932 } 1933 CATCH 1869 1934 1870 1935 /*! … … 1874 1939 */ 1875 1940 bool CGrid::doGridHaveDataToWrite() 1941 TRY 1876 1942 { 1877 1943 return (0 != writtenDataSize_); 1878 1944 } 1945 CATCH_DUMP_ATTR 1879 1946 1880 1947 /*! … … 1885 1952 */ 1886 1953 size_t CGrid::getWrittenDataSize() const 1954 TRY 1887 1955 { 1888 1956 return writtenDataSize_; 1889 1957 } 1958 CATCH 1890 1959 1891 1960 /*! … … 1894 1963 */ 1895 1964 int CGrid::getNumberWrittenIndexes() const 1965 TRY 1896 1966 { 1897 1967 return numberWrittenIndexes_; 1898 1968 } 1969 CATCH 1899 1970 1900 1971 /*! … … 1903 1974 */ 1904 1975 int CGrid::getTotalNumberWrittenIndexes() const 1976 TRY 1905 1977 { 1906 1978 return totalNumberWrittenIndexes_; 1907 1979 } 1980 CATCH 1908 1981 1909 1982 /*! … … 1912 1985 */ 1913 1986 int CGrid::getOffsetWrittenIndexes() const 1987 TRY 1914 1988 { 1915 1989 return offsetWrittenIndexes_; 1916 1990 } 1991 CATCH 1917 1992 1918 1993 CDistributionServer* CGrid::getDistributionServer() 1994 TRY 1919 1995 { 1920 1996 return serverDistribution_; 1921 1997 } 1998 CATCH_DUMP_ATTR 1922 1999 1923 2000 CDistributionClient* CGrid::getDistributionClient() 2001 TRY 1924 2002 { 1925 2003 return clientDistribution_; 1926 2004 } 2005 CATCH_DUMP_ATTR 1927 2006 1928 2007 bool CGrid::doGridHaveDataDistributed(CContextClient* client) 2008 TRY 1929 2009 { 1930 2010 if (isScalarGrid()) return false; … … 1936 2016 return isDataDistributed_; 1937 2017 } 2018 CATCH_DUMP_ATTR 1938 2019 1939 2020 /*! … … 1945 2026 */ 1946 2027 bool CGrid::dispatchEvent(CEventServer& event) 2028 TRY 1947 2029 { 1948 2030 … … 1978 2060 } 1979 2061 } 2062 CATCH 1980 2063 1981 2064 ///--------------------------------------------------------------- 1982 2065 1983 2066 CDomain* CGrid::addDomain(const std::string& id) 2067 TRY 1984 2068 { 1985 2069 order_.push_back(2); … … 1988 2072 return vDomainGroup_->createChild(id); 1989 2073 } 2074 CATCH_DUMP_ATTR 1990 2075 1991 2076 CAxis* CGrid::addAxis(const std::string& id) 2077 TRY 1992 2078 { 1993 2079 order_.push_back(1); … … 1996 2082 return vAxisGroup_->createChild(id); 1997 2083 } 2084 CATCH_DUMP_ATTR 1998 2085 1999 2086 CScalar* CGrid::addScalar(const std::string& id) 2087 TRY 2000 2088 { 2001 2089 order_.push_back(0); … … 2004 2092 return vScalarGroup_->createChild(id); 2005 2093 } 2094 CATCH_DUMP_ATTR 2006 2095 2007 2096 //! Change virtual field group to a new one 2008 2097 void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup) 2098 TRY 2009 2099 { 2010 2100 this->vDomainGroup_ = newVDomainGroup; 2011 2101 } 2102 CATCH_DUMP_ATTR 2012 2103 2013 2104 //! Change virtual variable group to new one 2014 2105 void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup) 2106 TRY 2015 2107 { 2016 2108 this->vAxisGroup_ = newVAxisGroup; 2017 2109 } 2110 CATCH_DUMP_ATTR 2018 2111 2019 2112 //! Change virtual variable group to new one 2020 2113 void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup) 2114 TRY 2021 2115 { 2022 2116 this->vScalarGroup_ = newVScalarGroup; 2023 2117 } 2118 CATCH_DUMP_ATTR 2024 2119 2025 2120 /*! … … 2028 2123 */ 2029 2124 void CGrid::sendAddDomain(const string& id) 2030 { 2125 TRY 2126 { 2031 2127 sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN); 2032 2128 } 2129 CATCH_DUMP_ATTR 2033 2130 2034 2131 /*! … … 2037 2134 */ 2038 2135 void CGrid::sendAddAxis(const string& id) 2136 TRY 2039 2137 { 2040 2138 sendAddItem(id, (int)EVENT_ID_ADD_AXIS); 2041 2139 } 2140 CATCH_DUMP_ATTR 2042 2141 2043 2142 /*! … … 2046 2145 */ 2047 2146 void CGrid::sendAddScalar(const string& id) 2147 TRY 2048 2148 { 2049 2149 sendAddItem(id, (int)EVENT_ID_ADD_SCALAR); 2050 2150 } 2151 CATCH_DUMP_ATTR 2051 2152 2052 2153 /*! … … 2055 2156 */ 2056 2157 void CGrid::recvAddDomain(CEventServer& event) 2158 TRY 2057 2159 { 2058 2160 … … 2062 2164 get(id)->recvAddDomain(*buffer); 2063 2165 } 2166 CATCH 2064 2167 2065 2168 /*! … … 2068 2171 */ 2069 2172 void CGrid::recvAddDomain(CBufferIn& buffer) 2173 TRY 2070 2174 { 2071 2175 string id; … … 2073 2177 addDomain(id); 2074 2178 } 2179 CATCH_DUMP_ATTR 2075 2180 2076 2181 /*! … … 2079 2184 */ 2080 2185 void CGrid::recvAddAxis(CEventServer& event) 2186 TRY 2081 2187 { 2082 2188 … … 2086 2192 get(id)->recvAddAxis(*buffer); 2087 2193 } 2194 CATCH 2088 2195 2089 2196 /*! … … 2092 2199 */ 2093 2200 void CGrid::recvAddAxis(CBufferIn& buffer) 2201 TRY 2094 2202 { 2095 2203 string id; … … 2097 2205 addAxis(id); 2098 2206 } 2207 CATCH_DUMP_ATTR 2099 2208 2100 2209 /*! … … 2103 2212 */ 2104 2213 void CGrid::recvAddScalar(CEventServer& event) 2214 TRY 2105 2215 { 2106 2216 … … 2110 2220 get(id)->recvAddScalar(*buffer); 2111 2221 } 2222 CATCH 2112 2223 2113 2224 /*! … … 2116 2227 */ 2117 2228 void CGrid::recvAddScalar(CBufferIn& buffer) 2229 TRY 2118 2230 { 2119 2231 string id; … … 2121 2233 addScalar(id); 2122 2234 } 2235 CATCH_DUMP_ATTR 2123 2236 2124 2237 /*! … … 2129 2242 */ 2130 2243 void CGrid::solveDomainAxisRefInheritance(bool apply) 2244 TRY 2131 2245 { 2132 2246 CContext* context = CContext::getCurrent(); … … 2169 2283 } 2170 2284 } 2285 CATCH_DUMP_ATTR 2171 2286 2172 2287 bool CGrid::isTransformed() 2288 TRY 2173 2289 { 2174 2290 return isTransformed_; 2175 2291 } 2292 CATCH_DUMP_ATTR 2176 2293 2177 2294 void CGrid::setTransformed() 2295 TRY 2178 2296 { 2179 2297 isTransformed_ = true; 2180 2298 } 2299 CATCH_DUMP_ATTR 2181 2300 2182 2301 CGridTransformation* CGrid::getTransformations() 2302 TRY 2183 2303 { 2184 2304 return transformations_; 2185 2305 } 2306 CATCH_DUMP_ATTR 2186 2307 2187 2308 void CGrid::addTransGridSource(CGrid* gridSrc) 2309 TRY 2188 2310 { 2189 2311 if (gridSrc_.end() == gridSrc_.find(gridSrc)) 2190 2312 gridSrc_.insert(make_pair(gridSrc,make_pair(false,""))); 2191 2313 } 2314 CATCH_DUMP_ATTR 2192 2315 2193 2316 std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource() 2317 TRY 2194 2318 { 2195 2319 return gridSrc_; 2196 2320 } 2321 CATCH_DUMP_ATTR 2197 2322 2198 2323 /*! … … 2201 2326 */ 2202 2327 void CGrid::completeGrid(CGrid* transformGridSrc) 2328 TRY 2203 2329 { 2204 2330 if (0 != transformGridSrc) … … 2219 2345 gridGenerate.completeGrid(); 2220 2346 } 2347 CATCH_DUMP_ATTR 2221 2348 2222 2349 bool CGrid::isGenerated() 2350 TRY 2223 2351 { 2224 2352 return isGenerated_; 2225 2353 } 2354 CATCH 2226 2355 2227 2356 void CGrid::setGenerated() 2357 TRY 2228 2358 { 2229 2359 isGenerated_ = true; 2230 2360 } 2361 CATCH_DUMP_ATTR 2231 2362 2232 2363 void CGrid::transformGrid(CGrid* transformGridSrc) 2364 TRY 2233 2365 { 2234 2366 if (!transformGridSrc) … … 2256 2388 transformGridSrc->checkMaskIndex(false); 2257 2389 } 2390 CATCH_DUMP_ATTR 2258 2391 2259 2392 bool CGrid::hasTransform() 2393 TRY 2260 2394 { 2261 2395 if (hasTransform_) return hasTransform_; … … 2271 2405 return hasTransform_; 2272 2406 } 2407 CATCH_DUMP_ATTR 2273 2408 2274 2409 /*! … … 2277 2412 */ 2278 2413 std::vector<CDomain*> CGrid::getDomains() 2414 TRY 2279 2415 { 2280 2416 std::vector<CDomain*> domList; … … 2285 2421 return domList; 2286 2422 } 2423 CATCH_DUMP_ATTR 2287 2424 2288 2425 /*! … … 2291 2428 */ 2292 2429 std::vector<CAxis*> CGrid::getAxis() 2430 TRY 2293 2431 { 2294 2432 std::vector<CAxis*> aList; … … 2298 2436 return aList; 2299 2437 } 2438 CATCH_DUMP_ATTR 2300 2439 2301 2440 /*! … … 2304 2443 */ 2305 2444 std::vector<CScalar*> CGrid::getScalars() 2445 TRY 2306 2446 { 2307 2447 std::vector<CScalar*> sList; … … 2311 2451 return sList; 2312 2452 } 2453 CATCH_DUMP_ATTR 2313 2454 2314 2455 /*! … … 2317 2458 */ 2318 2459 CDomain* CGrid::getDomain(int domainIndex) 2460 TRY 2319 2461 { 2320 2462 std::vector<CDomain*> domainListP = this->getDomains(); … … 2334 2476 return domainListP[domainIndex]; 2335 2477 } 2478 CATCH_DUMP_ATTR 2336 2479 2337 2480 /*! … … 2340 2483 */ 2341 2484 CAxis* CGrid::getAxis(int axisIndex) 2485 TRY 2342 2486 { 2343 2487 std::vector<CAxis*> axisListP = this->getAxis(); … … 2357 2501 return axisListP[axisIndex]; 2358 2502 } 2503 CATCH_DUMP_ATTR 2359 2504 2360 2505 /*! … … 2363 2508 */ 2364 2509 CScalar* CGrid::getScalar(int scalarIndex) 2510 TRY 2365 2511 { 2366 2512 std::vector<CScalar*> scalarListP = this->getScalars(); … … 2380 2526 return scalarListP[scalarIndex]; 2381 2527 } 2528 CATCH_DUMP_ATTR 2382 2529 2383 2530 /*! … … 2386 2533 */ 2387 2534 void CGrid::setDomainList(const std::vector<CDomain*> domains) 2535 TRY 2388 2536 { 2389 2537 if (isDomListSet) return; … … 2406 2554 isDomListSet = true; 2407 2555 } 2408 2409 }2556 } 2557 CATCH_DUMP_ATTR 2410 2558 2411 2559 /*! … … 2414 2562 */ 2415 2563 void CGrid::setAxisList(const std::vector<CAxis*> axis) 2564 TRY 2416 2565 { 2417 2566 if (isAxisListSet) return; … … 2435 2584 } 2436 2585 } 2586 CATCH_DUMP_ATTR 2437 2587 2438 2588 /*! … … 2441 2591 */ 2442 2592 void CGrid::setScalarList(const std::vector<CScalar*> scalars) 2593 TRY 2443 2594 { 2444 2595 if (isScalarListSet) return; … … 2462 2613 } 2463 2614 } 2615 CATCH_DUMP_ATTR 2464 2616 2465 2617 /*! … … 2468 2620 */ 2469 2621 std::vector<StdString> CGrid::getDomainList() 2622 TRY 2470 2623 { 2471 2624 setDomainList(); 2472 2625 return domList_; 2473 2626 } 2627 CATCH 2474 2628 2475 2629 /*! … … 2478 2632 */ 2479 2633 std::vector<StdString> CGrid::getAxisList() 2634 TRY 2480 2635 { 2481 2636 setAxisList(); 2482 2637 return axisList_; 2483 2638 } 2639 CATCH 2484 2640 2485 2641 /*! … … 2488 2644 */ 2489 2645 std::vector<StdString> CGrid::getScalarList() 2646 TRY 2490 2647 { 2491 2648 setScalarList(); 2492 2649 return scalarList_; 2493 2650 } 2651 CATCH 2494 2652 2495 2653 /*! … … 2497 2655 */ 2498 2656 void CGrid::sendAllDomains() 2657 TRY 2499 2658 { 2500 2659 std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren(); … … 2506 2665 } 2507 2666 } 2667 CATCH_DUMP_ATTR 2508 2668 2509 2669 /*! … … 2511 2671 */ 2512 2672 void CGrid::sendAllAxis() 2673 TRY 2513 2674 { 2514 2675 std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren(); … … 2521 2682 } 2522 2683 } 2684 CATCH_DUMP_ATTR 2523 2685 2524 2686 /*! … … 2526 2688 */ 2527 2689 void CGrid::sendAllScalars() 2690 TRY 2528 2691 { 2529 2692 std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren(); … … 2536 2699 } 2537 2700 } 2701 CATCH_DUMP_ATTR 2538 2702 2539 2703 void CGrid::setContextClient(CContextClient* contextClient) 2704 TRY 2540 2705 { 2541 2706 if (clientsSet.find(contextClient)==clientsSet.end()) … … 2549 2714 this->getAxis()[i]->setContextClient(contextClient); 2550 2715 } 2716 CATCH_DUMP_ATTR 2551 2717 2552 2718 /*! … … 2554 2720 */ 2555 2721 void CGrid::parse(xml::CXMLNode& node) 2722 TRY 2556 2723 { 2557 2724 SuperClass::parse(node); … … 2594 2761 setScalarList(); 2595 2762 } 2763 CATCH_DUMP_ATTR 2764 2596 2765 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.