/[escript]/trunk/escript/src/DataExpanded.cpp
ViewVC logotype

Diff of /trunk/escript/src/DataExpanded.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1137 by gross, Thu May 10 08:11:31 2007 UTC revision 1141 by gross, Tue May 15 04:24:51 2007 UTC
# Line 649  DataExpanded::dump(const std::string fil Line 649  DataExpanded::dump(const std::string fil
649     int type=  getFunctionSpace().getTypeCode();     int type=  getFunctionSpace().getTypeCode();
650     int ndims =0;     int ndims =0;
651     long dims[ldims];     long dims[ldims];
652       const double* d_ptr=&(m_data[0]);
653     DataArrayView::ShapeType shape = getPointDataView().getShape();     DataArrayView::ShapeType shape = getPointDataView().getShape();
654    
655     // netCDF error handler     // netCDF error handler
# Line 658  DataExpanded::dump(const std::string fil Line 659  DataExpanded::dump(const std::string fil
659     // check if writing was successful     // check if writing was successful
660     if (!dataFile.is_valid())     if (!dataFile.is_valid())
661          throw DataException("Error - DataExpanded:: opening of netCDF file for output failed.");          throw DataException("Error - DataExpanded:: opening of netCDF file for output failed.");
662     if (!dataFile.add_att("type","expanded") )     if (!dataFile.add_att("type_id",2) )
663          throw DataException("Error - DataExpanded:: appending data type to netCDF file failed.");          throw DataException("Error - DataExpanded:: appending data type to netCDF file failed.");
664     if (!dataFile.add_att("rank",rank) )     if (!dataFile.add_att("rank",rank) )
665          throw DataException("Error - DataExpanded:: appending rank attribute to netCDF file failed.");          throw DataException("Error - DataExpanded:: appending rank attribute to netCDF file failed.");
# Line 700  DataExpanded::dump(const std::string fil Line 701  DataExpanded::dump(const std::string fil
701    
702     if (! ( var = dataFile.add_var("data", ncDouble, ndims, ncdims)) )     if (! ( var = dataFile.add_var("data", ncDouble, ndims, ncdims)) )
703          throw DataException("Error - DataExpanded:: appending variable to netCDF file failed.");          throw DataException("Error - DataExpanded:: appending variable to netCDF file failed.");
704     if (! (var->put(&m_data[0],dims)) )     if (! (var->put(d_ptr,dims)) )
705          throw DataException("Error - DataExpanded:: copy data to netCDF buffer failed.");          throw DataException("Error - DataExpanded:: copy data to netCDF buffer failed.");
706     #else     #else
707     throw DataException("Error - DataExpanded:: dump is not configured with netCDF. Please contact your installation manager.");     throw DataException("Error - DataExpanded:: dump is not configured with netCDF. Please contact your installation manager.");

Legend:
Removed from v.1137  
changed lines
  Added in v.1141

  ViewVC Help
Powered by ViewVC 1.1.26