Ignore:
Timestamp:
11/15/17 12:14:34 (7 years ago)
Author:
yushan
Message:

dev_omp

File:
1 edited

Legend:

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

    r1134 r1328  
    66 
    77#include "mesh.hpp" 
     8using namespace ep_lib; 
    89 
    910namespace xios { 
     
    3132  } 
    3233 
    33   std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>(); 
    34   std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >(); 
     34  //std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>(); 
     35  //std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >(); 
    3536 
    3637  std::map <StdString, CMesh> *CMesh::meshList_ptr = 0; 
    3738  std::map <StdString, vector<int> > *CMesh::domainList_ptr = 0; 
    38  
    3939 
    4040///--------------------------------------------------------------- 
     
    4545 * \param [in] nvertex Number of verteces (1 for nodes, 2 for edges, 3 and up for faces). 
    4646 */ 
    47  
    48 /* bkp 
    49   CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
    50   { 
    51     CMesh::domainList[meshName].push_back(nvertex); 
    52  
    53     if ( CMesh::meshList.begin() != CMesh::meshList.end() ) 
    54     { 
    55       for (std::map<StdString, CMesh>::iterator it=CMesh::meshList.begin(); it!=CMesh::meshList.end(); ++it) 
    56       { 
    57         if (it->first == meshName) 
    58           return &meshList[meshName]; 
    59         else 
    60         { 
    61           CMesh newMesh; 
    62           CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
    63           return &meshList[meshName]; 
    64         } 
    65       } 
    66     } 
    67     else 
    68     { 
    69       CMesh newMesh; 
    70       CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
    71       return &meshList[meshName]; 
    72     } 
    73   } 
    74 */ 
    75  
    7647  CMesh* CMesh::getMesh (StdString meshName, int nvertex) 
    7748  { 
     
    7950    if(CMesh::meshList_ptr == NULL)   CMesh::meshList_ptr   = new std::map <StdString, CMesh>(); 
    8051 
    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) 
     52    //CMesh::domainList[meshName].push_back(nvertex); 
     53    CMesh::domainList_ptr->at(meshName).push_back(nvertex); 
     54 
     55    //if ( CMesh::meshList.begin() != CMesh::meshList.end() ) 
     56    if ( CMesh::meshList_ptr->begin() != CMesh::meshList_ptr->end() ) 
     57    { 
     58      //for (std::map<StdString, CMesh>::iterator it=CMesh::meshList.begin(); it!=CMesh::meshList.end(); ++it) 
     59      for (std::map<StdString, CMesh>::iterator it=CMesh::meshList_ptr->begin(); it!=CMesh::meshList_ptr->end(); ++it) 
    8660      { 
    8761        if (it->first == meshName) 
    88           return &((*CMesh::meshList_ptr)[meshName]); 
     62          //return &meshList[meshName]; 
     63          return &meshList_ptr->at(meshName); 
    8964        else 
    9065        { 
    9166          CMesh newMesh; 
    92           (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
    93           return &((*CMesh::meshList_ptr)[meshName]); 
     67          //CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
     68          CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) ); 
     69          //return &meshList[meshName]; 
     70          return &meshList_ptr->at(meshName); 
    9471        } 
    9572      } 
     
    9875    { 
    9976      CMesh newMesh; 
    100       (*CMesh::meshList_ptr).insert( make_pair(meshName, newMesh) ); 
    101       return &((*CMesh::meshList_ptr)[meshName]); 
     77      //CMesh::meshList.insert( make_pair(meshName, newMesh) ); 
     78      CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) ); 
     79      //return &meshList[meshName]; 
     80      return &meshList_ptr->at(meshName); 
    10281    } 
    10382  } 
     
    524503 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 
    525504 */ 
    526   void CMesh::createMeshEpsilon(const ep_lib::MPI_Comm& comm, 
     505  void CMesh::createMeshEpsilon(const MPI_Comm& comm, 
    527506                                const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue, 
    528507                                const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat) 
     
    17241703   */ 
    17251704 
    1726   void CMesh::getGloNghbFacesNodeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1705  void CMesh::getGloNghbFacesNodeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    17271706                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    17281707                               CArray<int, 2>& nghbFaces) 
     
    18801859   */ 
    18811860 
    1882   void CMesh::getGloNghbFacesEdgeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx, 
     1861  void CMesh::getGloNghbFacesEdgeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx, 
    18831862                               const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
    18841863                               CArray<int, 2>& nghbFaces) 
     
    20612040   */ 
    20622041 
    2063   void CMesh::getGlobalNghbFaces(const int nghbType, const ep_lib::MPI_Comm& comm, 
     2042  void CMesh::getGlobalNghbFaces(const int nghbType, const MPI_Comm& comm, 
    20642043                                 const CArray<int, 1>& face_idx, 
    20652044                                 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 
Note: See TracChangeset for help on using the changeset viewer.