Ignore:
Timestamp:
05/16/17 17:54:30 (7 years ago)
Author:
yushan
Message:

branch merged with trunk r1130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/node/mesh.cpp

    r1002 r1134  
    3434  std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >(); 
    3535 
     36  std::map <StdString, CMesh> *CMesh::meshList_ptr = 0; 
     37  std::map <StdString, vector<int> > *CMesh::domainList_ptr = 0; 
     38 
     39 
    3640///--------------------------------------------------------------- 
    3741/*! 
     
    4145 * \param [in] nvertex Number of verteces (1 for nodes, 2 for edges, 3 and up for faces). 
    4246 */ 
     47 
     48/* bkp 
    4349  CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
    4450  { 
     
    6470      CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
    6571      return &meshList[meshName]; 
     72    } 
     73  } 
     74*/ 
     75 
     76  CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
     77  { 
     78    if(CMesh::domainList_ptr == NULL) CMesh::domainList_ptr = new std::map <StdString, vector<int> >(); 
     79    if(CMesh::meshList_ptr == NULL)   CMesh::meshList_ptr   = new std::map <StdString, CMesh>(); 
     80 
     81    (*CMesh::domainList_ptr)[meshName].push_back(nvertex); 
     82 
     83    if ( (*CMesh::meshList_ptr).begin() != (*CMesh::meshList_ptr).end() ) 
     84    { 
     85      for (std::map<StdString, CMesh>::iterator it=(*CMesh::meshList_ptr).begin(); it!=(*CMesh::meshList_ptr).end(); ++it) 
     86      { 
     87        if (it->first == meshName) 
     88          return &((*CMesh::meshList_ptr)[meshName]); 
     89        else 
     90        { 
     91          CMesh newMesh; 
     92          (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
     93          return &((*CMesh::meshList_ptr)[meshName]); 
     94        } 
     95      } 
     96    } 
     97    else 
     98    { 
     99      CMesh newMesh; 
     100      (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
     101      return &((*CMesh::meshList_ptr)[meshName]); 
    66102    } 
    67103  } 
     
    488524 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 
    489525 */ 
    490   void CMesh::createMeshEpsilon(const MPI_Comm& comm, 
     526  void CMesh::createMeshEpsilon(const ep_lib::MPI_Comm& comm, 
    491527                                const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue, 
    492528                                const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat) 
     
    16881724   */ 
    16891725 
    1690   void CMesh::getGloNghbFacesNodeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1726  void CMesh::getGloNghbFacesNodeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    16911727                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    16921728                               CArray<int, 2>& nghbFaces) 
     
    18441880   */ 
    18451881 
    1846   void CMesh::getGloNghbFacesEdgeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1882  void CMesh::getGloNghbFacesEdgeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    18471883                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    18481884                               CArray<int, 2>& nghbFaces) 
     
    20252061   */ 
    20262062 
    2027   void CMesh::getGlobalNghbFaces(const int nghbType, const MPI_Comm& comm, 
     2063  void CMesh::getGlobalNghbFaces(const int nghbType, const ep_lib::MPI_Comm& comm, 
    20282064                                 const CArray<int, 1>& face_idx, 
    20292065                                 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
Note: See TracChangeset for help on using the changeset viewer.