/[escript]/branches/lapack2681/escript/src/DataConstant.cpp
ViewVC logotype

Diff of /branches/lapack2681/escript/src/DataConstant.cpp

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

revision 1118 by gross, Tue Apr 24 08:55:04 2007 UTC revision 1149 by gross, Thu May 17 00:30:15 2007 UTC
# Line 18  Line 18 
18  #include <iostream>  #include <iostream>
19  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
20  #ifdef USE_NETCDF  #ifdef USE_NETCDF
21  #include <netcdfcpp.h>  #include "netcdfcpp.h"
22  #endif  #endif
23    
24  using namespace std;  using namespace std;
# Line 54  DataConstant::DataConstant(const DataArr Line 54  DataConstant::DataConstant(const DataArr
54    
55  DataConstant::DataConstant(const DataConstant& other)  DataConstant::DataConstant(const DataConstant& other)
56    : DataAbstract(other.getFunctionSpace())    : DataAbstract(other.getFunctionSpace())
57  {  {  //
   //  
58    // copy the data in the correct format    // copy the data in the correct format
59    m_data=other.m_data;    m_data=other.m_data;
60    //    //
# Line 263  DataConstant::eigenvalues_and_eigenvecto Line 262  DataConstant::eigenvalues_and_eigenvecto
262    DataArrayView evView=ev->getPointDataView();    DataArrayView evView=ev->getPointDataView();
263    DataArrayView VView=V->getPointDataView();    DataArrayView VView=V->getPointDataView();
264    
265    DataArrayView::eigenvalues_and_eigenvectors(thisView,0,evView,0,VView,tol);    DataArrayView::eigenvalues_and_eigenvectors(thisView,0,evView,0,VView,0,tol);
266  }  }
267    
268  void  void
# Line 286  DataConstant::dump(const std::string fil Line 285  DataConstant::dump(const std::string fil
285     int type=  getFunctionSpace().getTypeCode();     int type=  getFunctionSpace().getTypeCode();
286     int ndims =0;     int ndims =0;
287     long dims[DataArrayView::maxRank];     long dims[DataArrayView::maxRank];
288       const double* d_ptr=&(m_data[0]);
289     DataArrayView::ShapeType shape = getPointDataView().getShape();     DataArrayView::ShapeType shape = getPointDataView().getShape();
290        
291     // netCDF error handler     // netCDF error handler
# Line 295  DataConstant::dump(const std::string fil Line 295  DataConstant::dump(const std::string fil
295     // check if writing was successful     // check if writing was successful
296     if (!dataFile.is_valid())     if (!dataFile.is_valid())
297      throw DataException("Error - DataConstant:: opening of netCDF file for output failed.");      throw DataException("Error - DataConstant:: opening of netCDF file for output failed.");
298     if (!dataFile.add_att("type","constant") )     if (!dataFile.add_att("type_id",0) )
299      throw DataException("Error - DataConstant:: appending data type to netCDF file failed.");      throw DataException("Error - DataConstant:: appending data type to netCDF file failed.");
300     if (!dataFile.add_att("rank",rank) )     if (!dataFile.add_att("rank",rank) )
301      throw DataException("Error - DataConstant:: appending rank attribute to netCDF file failed.");      throw DataException("Error - DataConstant:: appending rank attribute to netCDF file failed.");
# Line 328  DataConstant::dump(const std::string fil Line 328  DataConstant::dump(const std::string fil
328          throw DataException("Error - DataConstant:: appending ncdimsion 3 to netCDF file failed.");          throw DataException("Error - DataConstant:: appending ncdimsion 3 to netCDF file failed.");
329         }         }
330     }     }
331      
332     if (! ( var = dataFile.add_var("data", ncDouble, ndims, ncdims)) )     if (! ( var = dataFile.add_var("data", ncDouble, ndims, ncdims)) )
333      throw DataException("Error - DataConstant:: appending variable to netCDF file failed.");      throw DataException("Error - DataConstant:: appending variable to netCDF file failed.");
334     if (! (var->put(&m_data[0],dims)) )     if (! (var->put(d_ptr,dims)) )
335      throw DataException("Error - DataConstant:: copy data to netCDF buffer failed.");           throw DataException("Error - DataConstant:: copy data to netCDF buffer failed.");
336     #else     #else
337     throw DataException("Error - DataConstant:: dump is not configured with netCDF. Please contact your installation manager.");     throw DataException("Error - DataConstant:: dump is not configured with netCDF. Please contact your installation manager.");
338     #endif     #endif

Legend:
Removed from v.1118  
changed lines
  Added in v.1149

  ViewVC Help
Powered by ViewVC 1.1.26