Changeset 881
- Timestamp:
- 07/04/16 19:21:28 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/nc4_data_output.cpp
r879 r881 50 50 void CNc4DataOutput::writeDomain_(CDomain* domain) 51 51 { 52 53 54 if (SuperClassWriter::useCFConvention)55 writeUnstructuredDomain(domain) ;56 else57 writeUnstructuredDomainUgrid(domain) ;58 59 52 if (domain->type == CDomain::type_attr::unstructured) 53 { 54 if (SuperClassWriter::useCFConvention) 55 writeUnstructuredDomain(domain) ; 56 else 57 writeUnstructuredDomainUgrid(domain) ; 58 return ; 59 } 60 60 61 61 CContext* context = CContext::getCurrent() ; … … 66 66 67 67 if (domain->isEmpty()) 68 if (SuperClass::type==MULTI_FILE) return 68 if (SuperClass::type==MULTI_FILE) return; 69 69 70 70 std::vector<StdString> dim0, dim1; … … 449 449 StdString domid = domain->getDomainOutputName(); 450 450 StdString domainName = domain->name; 451 452 if (domain->mesh->isWritten(domainName)) domain->mesh = CMesh::getMesh; 453 451 domain->assignMesh(domainName); 454 452 //domain->mesh->createMesh(domain->lonvalue_srv, domain->latvalue_srv, domain->bounds_lon_srv, domain->bounds_lat_srv); 455 453 domain->mesh->createMeshEpsilon(domain->lonvalue_srv, domain->latvalue_srv, domain->bounds_lon_srv, domain->bounds_lat_srv); … … 650 648 if (domain->nvertex == 1) 651 649 { 652 650 if ( (!domain->mesh->edgesAreWritten) && (!domain->mesh->facesAreWritten) ) 653 651 { 654 652 SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0); … … 658 656 if (domain->nvertex == 2) 659 657 { 660 658 if (!domain->mesh->facesAreWritten) 661 659 { 662 660 if (!domain->mesh->nodesAreWritten) -
XIOS/trunk/src/node/domain.cpp
r878 r881 36 36 , isRedistributed_(false) 37 37 { 38 mesh = new CMesh();38 //mesh = new CMesh(); 39 39 } 40 40 … … 47 47 , isRedistributed_(false) 48 48 { 49 mesh = new CMesh();49 //mesh = new CMesh(); 50 50 } 51 51 52 52 CDomain::~CDomain(void) 53 53 { 54 delete mesh;54 //delete mesh; 55 55 } 56 56 57 57 ///--------------------------------------------------------------- 58 59 void CDomain::assignMesh(const StdString meshName) 60 { 61 mesh = CMesh::getMesh(meshName); 62 } 58 63 59 64 CDomain* CDomain::createDomain() -
XIOS/trunk/src/node/domain.hpp
r878 r881 67 67 68 68 CMesh* mesh; 69 void assignMesh(const StdString); 69 70 70 71 virtual void parse(xml::CXMLNode & node); -
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, -
XIOS/trunk/src/node/mesh.hpp
r879 r881 9 9 10 10 #include "array_new.hpp" 11 #include "client_client_dht_template.hpp" 11 12 12 13 namespace xios { … … 53 54 const CArray<double, 2>&, const CArray<double, 2>& ); 54 55 55 void createMeshEpsilon(const CArray<double, 1>&, const CArray<double, 1>&, 56 void createMeshEpsilon(const CArray<double, 1>&, const CArray<double, 1>&, 56 57 const CArray<double, 2>&, const CArray<double, 2>& ); 57 58 58 bool isWritten (StdString); 59 static CMesh* getMesh; 60 61 private: 59 static CMesh* getMesh(StdString); 62 60 63 static std::map <StdString, CMesh*> meshList; 61 private: 62 63 static std::map <StdString, CMesh> meshList; 64 64 65 65 size_t nodeIndex (double, double);
Note: See TracChangeset
for help on using the changeset viewer.