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

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

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

revision 1486 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1487 by gross, Thu Apr 10 05:28:01 2008 UTC
# Line 17  Line 17 
17    
18  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
19  #include <iostream>  #include <iostream>
20    #include <exception>
21  #ifdef USE_NETCDF  #ifdef USE_NETCDF
22  #include <netcdfcpp.h>  #include <netcdfcpp.h>
23  #endif  #endif
# Line 253  load(const std::string fileName, Line 254  load(const std::string fileName,
254            #pragma omp critical            #pragma omp critical
255            if (local_failed>=0) failed = local_failed;            if (local_failed>=0) failed = local_failed;
256        }        }
257        if (failed>=0)        /* if (failed>=0)
258        {        {
259           free(ids_of_nc);           free(ids_of_nc);
260           throw DataException("Error - load:: data ordering in netCDF file does not match ordering of FunctionSpace.");           throw DataException("Error - load:: data ordering in netCDF file does not match ordering of FunctionSpace.");
261        }        } */
262        // get the data:        // get the data:
263        dims[rank]=num_data_points_per_sample;        dims[rank]=num_data_points_per_sample;
264        dims[rank+1]=num_samples;        dims[rank+1]=num_samples;
# Line 272  load(const std::string fileName, Line 273  load(const std::string fileName,
273           free(ids_of_nc);           free(ids_of_nc);
274           throw DataException("Error - load:: unable to recover data from netCDF file.");           throw DataException("Error - load:: unable to recover data from netCDF file.");
275        }        }
276        // if (failed==-1)        if (failed>=0) {
277        //   out->m_data.reorderByReferenceIDs(ids_of_nc)          try {
278        free(ids_of_nc);             std::cout << "Information - load: start reordering data from netCDF file " << fileName << std::endl;
279               out.borrowData()->reorderByReferenceIDs(ids_of_nc);
280            }
281            catch (std::exception& e) {
282               free(ids_of_nc);
283               throw DataException("Error - load:: unable to reorder data in netCDF file.");
284            }
285          }
286     } else {     } else {
287         throw DataException("Error - load:: unknown escript data type in netCDF file.");         throw DataException("Error - load:: unknown escript data type in netCDF file.");
288     }     }

Legend:
Removed from v.1486  
changed lines
  Added in v.1487

  ViewVC Help
Powered by ViewVC 1.1.26