Changeset 881 for XIOS/trunk/src/node/mesh.cpp
- Timestamp:
- 07/04/16 19:21:28 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/mesh.cpp
r879 r881 26 26 } 27 27 28 std::map <StdString, CMesh *> CMesh::meshList = std::map <StdString, CMesh*>();29 CMesh* CMesh::getMesh;28 std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>(); 29 //CMesh* CMesh::getMesh; 30 30 31 31 ///--------------------------------------------------------------- 32 32 /*! 33 * \fn bool CMesh:: isWritten(StdString meshName)34 * Checks if a mesh has been written, updates the list of meshes stored in meshList33 * \fn bool CMesh::getMesh (StdString meshName) 34 * Returns a pointer to a mesh. If a mesh has not been created, creates it and adds its name to the list of meshes meshList. 35 35 * \param [in] meshName The name of a mesh ("name" attribute of a domain). 36 36 */ 37 bool CMesh::isWritten (StdString meshName) 38 { 39 if ( CMesh::meshList.begin() != CMesh::meshList.end() ) 40 { 41 if ( CMesh::meshList.find(meshName) != CMesh::meshList.end() ) 42 { 43 CMesh::getMesh = meshList[meshName]; 44 return true; 45 } 46 else 47 { 48 CMesh::meshList.insert( make_pair(meshName, this) ); 49 return false; 50 } 51 } 52 else 53 { 54 CMesh::meshList.insert( make_pair(meshName, this) ); 55 return false; 56 } 37 CMesh::CMesh* CMesh::getMesh (StdString meshName) 38 { 39 if ( CMesh::meshList.find(meshName) == CMesh::meshList.end() ) 40 { 41 CMesh::CMesh newMesh; 42 CMesh::meshList.insert( make_pair(meshName, newMesh) ); 43 44 } 45 return &meshList[meshName]; 57 46 } 58 47 … … 71 60 * Precision check is implemented with two hash values for each dimension, longitude and latitude. 72 61 * \param [in] lon Node longitude in degrees. 73 * \param [in] lat Node latitude in degre ss ranged from 0 to 360.62 * \param [in] lat Node latitude in degrees ranged from 0 to 360. 74 63 * \return node index if a node exists; -1 otherwise 75 64 */ … … 145 134 * Creates two hash values for each dimension, longitude and latitude. 146 135 * \param [in] lon Node longitude in degrees. 147 * \param [in] lat Node latitude in degre ss ranged from 0 to 360.136 * \param [in] lat Node latitude in degrees ranged from 0 to 360. 148 137 */ 138 149 139 void hashDblDbl (double lon, double lat) 150 140 { … … 217 207 * \param [in] latvalue Array of latitudes. 218 208 * \param [in] bounds_lon Array of boundary longitudes. Its size depends on the element type. 219 * \param [in] bounds_lat Array of boundar ry latitudes. Its size depends on the element type.209 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 220 210 */ 221 211 void CMesh::createMesh(const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue, … … 357 347 * \param [in] latvalue Array of latitudes. 358 348 * \param [in] bounds_lon Array of boundary longitudes. Its size depends on the element type. 359 * \param [in] bounds_lat Array of boundar ry latitudes. Its size depends on the element type.349 * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type. 360 350 */ 361 351 void CMesh::createMeshEpsilon(const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue,
Note: See TracChangeset
for help on using the changeset viewer.