Ignore:
Timestamp:
08/19/21 13:28:53 (3 years ago)
Author:
ymipsl
Message:

Bugs fix for UGRID convention output

  • global indexation was not taking into account
  • coherence problem in connectivity for node, edge and face mesh
  • add UGRID testcase based on sphere cube

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/mesh.cpp

    r1639 r2200  
    433433      node_lat = latvalue; 
    434434 
     435      unsigned long nodeCount = nbNodes_; 
     436      unsigned long nodeStart, nbNodes; 
     437      MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     438      int nNodes = nodeStart; 
     439      MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
     440      nbNodesGlo = nNodes; 
     441 
     442      nodeStart -= nodeCount; 
     443      node_start = nodeStart; 
     444      node_count = nodeCount; 
     445 
    435446      // Global node indexes 
    436447      vector<size_t> hashValues(4); 
     
    441452        for (size_t nh = 0; nh < 4; ++nh) 
    442453        { 
    443           nodeHash2IdxGlo[hashValues[nh]].push_back(mpiRank*nbNodes_ + nn); 
     454          nodeHash2IdxGlo[hashValues[nh]].push_back(nodeStart + nn);  
    444455        } 
    445456      } 
    446457      pNodeGlobalIndex = new CClientClientDHTSizet (nodeHash2IdxGlo, comm); 
     458 
    447459      nodesAreWritten = true; 
    448460    } 
     
    460472      unsigned long nbEdgesOnProc = nbEdges_; 
    461473      unsigned long nbEdgesAccum; 
     474      unsigned long nbEdgesGlo; 
    462475      MPI_Scan(&nbEdgesOnProc, &nbEdgesAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 
     476      nbEdgesGlo = nbEdgesAccum ; 
     477      MPI_Bcast(&nbEdgesGlo, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 
    463478      nbEdgesAccum -= nbEdges_; 
     479      edge_start = nbEdgesAccum ; 
     480      edge_count = nbEdgesOnProc ; 
    464481 
    465482      CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2IdxGlo; 
     
    670687    } //nvertex = 2 
    671688 
    672     else 
     689    else // nvertex > 2 
    673690    { 
    674691      nbFaces_ = bounds_lon.shape()[1]; 
     
    16011618  } // createMeshEpsilon 
    16021619 
     1620 
    16031621  ///---------------------------------------------------------------- 
    16041622  /*! 
Note: See TracChangeset for help on using the changeset viewer.