Changeset 1328 for XIOS/dev/branch_openmp/src/node/mesh.cpp
- Timestamp:
- 11/15/17 12:14:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/node/mesh.cpp
r1134 r1328 6 6 7 7 #include "mesh.hpp" 8 using namespace ep_lib; 8 9 9 10 namespace xios { … … 31 32 } 32 33 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> >(); 35 36 36 37 std::map <StdString, CMesh> *CMesh::meshList_ptr = 0; 37 38 std::map <StdString, vector<int> > *CMesh::domainList_ptr = 0; 38 39 39 40 40 ///--------------------------------------------------------------- … … 45 45 * \param [in] nvertex Number of verteces (1 for nodes, 2 for edges, 3 and up for faces). 46 46 */ 47 48 /* bkp49 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 else60 {61 CMesh newMesh;62 CMesh::meshList.insert( make_pair(meshName, newMesh) );63 return &meshList[meshName];64 }65 }66 }67 else68 {69 CMesh newMesh;70 CMesh::meshList.insert( make_pair(meshName, newMesh) );71 return &meshList[meshName];72 }73 }74 */75 76 47 CMesh* CMesh::getMesh (StdString meshName, int nvertex) 77 48 { … … 79 50 if(CMesh::meshList_ptr == NULL) CMesh::meshList_ptr = new std::map <StdString, CMesh>(); 80 51 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) 86 60 { 87 61 if (it->first == meshName) 88 return &((*CMesh::meshList_ptr)[meshName]); 62 //return &meshList[meshName]; 63 return &meshList_ptr->at(meshName); 89 64 else 90 65 { 91 66 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); 94 71 } 95 72 } … … 98 75 { 99 76 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); 102 81 } 103 82 } … … 524 503 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 525 504 */ 526 void CMesh::createMeshEpsilon(const ep_lib::MPI_Comm& comm,505 void CMesh::createMeshEpsilon(const MPI_Comm& comm, 527 506 const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue, 528 507 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat) … … 1724 1703 */ 1725 1704 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, 1727 1706 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 1728 1707 CArray<int, 2>& nghbFaces) … … 1880 1859 */ 1881 1860 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, 1883 1862 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat, 1884 1863 CArray<int, 2>& nghbFaces) … … 2061 2040 */ 2062 2041 2063 void CMesh::getGlobalNghbFaces(const int nghbType, const ep_lib::MPI_Comm& comm,2042 void CMesh::getGlobalNghbFaces(const int nghbType, const MPI_Comm& comm, 2064 2043 const CArray<int, 1>& face_idx, 2065 2044 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat,
Note: See TracChangeset
for help on using the changeset viewer.