Changeset 2250 for XIOS/trunk
- Timestamp:
- 10/25/21 14:34:40 (3 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/file.cpp
r2200 r2250 876 876 std::vector<int> domainNvertices; 877 877 std::vector<StdString> domainNames; 878 std::map<string, tuple< CDomain*,CDomain*,CDomain*>> registeredDomains ;878 std::map<string, tuple<set<CDomain*>,set<CDomain*>,set<CDomain*>>> registeredDomains ; 879 879 880 880 for (int i = 0; i < size; ++i) … … 920 920 } 921 921 922 if (nvertex==1) std::get<0>(registeredDomains[domainName]) =domain[0];923 else if (nvertex==2) std::get<1>(registeredDomains[domainName]) =domain[0];924 else std::get<2>(registeredDomains[domainName]) =domain[0];922 if (nvertex==1) std::get<0>(registeredDomains[domainName]).insert(domain[0]) ; 923 else if (nvertex==2) std::get<1>(registeredDomains[domainName]).insert(domain[0]) ; 924 else std::get<2>(registeredDomains[domainName]).insert(domain[0]) ; 925 925 } 926 926 … … 930 930 string domainName=it.first ; 931 931 932 if (std::get<0>(it.second)!=nullptr) domains.push_back(std::get<0>(it.second)) ;933 if (std::get<1>(it.second)!=nullptr) domains.push_back(std::get<1>(it.second)) ;934 if (std::get<2>(it.second)!=nullptr) domains.push_back(std::get<2>(it.second)) ;932 for(auto& domain : std::get<0>(it.second) ) domains.push_back(domain) ; 933 for(auto& domain : std::get<1>(it.second) ) domains.push_back(domain) ; 934 for(auto& domain : std::get<2>(it.second) ) domains.push_back(domain) ; 935 935 936 936 // for each component of a given mesh (i.e. domains with same name but different number of vertices) -
XIOS/trunk/src/node/mesh.cpp
r2200 r2250 427 427 if (nvertex == 1) 428 428 { 429 if (nodesAreWritten) return ; 430 429 431 nbNodes_ = lonvalue.numElements(); 430 432 node_lon.resize(nbNodes_); … … 449 451 for (size_t nn = 0; nn < nbNodes_; ++nn) 450 452 { 453 cout<<"MESH : "<<"node inserted : ("<< lonvalue(nn)<<","<< latvalue(nn)<<") index glo "<<nodeStart + nn<<" : hash => " ; 451 454 hashValues = CMesh::createHashes(lonvalue(nn), latvalue(nn)); 452 455 for (size_t nh = 0; nh < 4; ++nh) 453 456 { 454 nodeHash2IdxGlo[hashValues[nh]].push_back(nodeStart + nn); 455 } 457 nodeHash2IdxGlo[hashValues[nh]].push_back(nodeStart + nn); 458 cout<<hashValues[nh]<<" "; 459 } 460 cout<<endl ; 456 461 } 457 462 pNodeGlobalIndex = new CClientClientDHTSizet (nodeHash2IdxGlo, comm); … … 462 467 else if (nvertex == 2) 463 468 { 469 if (edgesAreWritten) return ; 470 464 471 nbEdges_ = bounds_lon.shape()[1]; 465 472 edge_lon.resize(nbEdges_); … … 508 515 for (int ne = 0; ne < nbEdges_; ++ne) 509 516 { 517 cout<<"MESH : "<<"insert edge " ; 510 518 for (int nv = 0; nv < nvertex; ++nv) 511 519 { … … 524 532 else 525 533 nodeIdxGlo2 = it->second[0]; 534 535 cout<<"("<<bounds_lon(nv, ne)<<","<<bounds_lat(nv, ne)<<")" ; 526 536 } 527 537 size_t edgeIdxGlo = nbEdgesAccum + ne; 528 538 edgeHash2IdxGlo[ hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2) ].push_back(edgeIdxGlo); 539 cout<<" nodes Id : "<<nodeIdxGlo1<<"&"<<nodeIdxGlo2<<" ; edge Id : "<<edgeIdxGlo<<" with hash : "<<hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2)<<endl ; 529 540 } 530 541 } // nodesAreWritten … … 689 700 else // nvertex > 2 690 701 { 702 if (facesAreWritten) return ; 703 691 704 nbFaces_ = bounds_lon.shape()[1]; 692 705 face_lon.resize(nbFaces_); … … 702 715 MPI_Scan(&nbFacesOnProc, &nbFacesAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 703 716 nbFacesAccum -= nbFaces_; 717 cout<<bounds_lon<<endl ; 718 cout<<bounds_lat<<endl ; 704 719 705 720 // Case (1): edges have been previously generated … … 722 737 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2; 723 738 CArray<size_t,1> edgeHashList(nbFaces_*nvertex); 739 724 740 size_t nEdge = 0; 725 741 for (int nf = 0; nf < nbFaces_; ++nf) … … 784 800 size_t faceIdxGlo = nbFacesAccum + nf; 785 801 size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 802 cout<<"MESH : "<<"find edge : ("<<bounds_lon(nv1,nf)<<","<<bounds_lat(nv1,nf)<<")&("<<bounds_lon(nv2,nf)<<","<<bounds_lat(nv2,nf) 803 <<") ; edgeHash "<<edgeHash<<" with node index : "<<it1->second[0]<<" & "<<it2->second[0]<<endl ; 786 804 itEdgeHash = edgeHash2IdxGlo.find(edgeHash); 787 805 size_t edgeIdxGlo = itEdgeHash->second[0]; … … 1308 1326 } 1309 1327 1310 // CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm);1328 // CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm); 1311 1329 // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 1312 1330 // Solution: global node indexing by hand. … … 1351 1369 // (3.3) Saving node data: node_lon, node_lat, and face_nodes 1352 1370 // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList 1353 // nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 1354 // node_count = dhtNodeIdxGlo.getIndexCount(); 1355 // node_start = dhtNodeIdxGlo.getIndexStart(); 1371 1372 // nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 1373 // node_count = dhtNodeIdxGlo.getIndexCount(); 1374 // node_start = dhtNodeIdxGlo.getIndexStart(); 1356 1375 node_lon.resize(node_count); 1357 1376 node_lat.resize(node_count); … … 1482 1501 // (3.5) Saving variables: edge_lon, edge_lat, face_edges 1483 1502 // Creating map edgeIdxGlo2Face <idxGlo, face> 1484 // nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal();1485 // edge_count = dhtEdgeIdxGlo.getIndexCount();1486 // edge_start = dhtEdgeIdxGlo.getIndexStart();1503 // nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1504 // edge_count = dhtEdgeIdxGlo.getIndexCount(); 1505 // edge_start = dhtEdgeIdxGlo.getIndexStart(); 1487 1506 1488 1507 edge_lon.resize(edge_count);
Note: See TracChangeset
for help on using the changeset viewer.