/[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 967 by gross, Tue Feb 13 09:40:12 2007 UTC revision 1131 by gross, Tue May 8 05:52:21 2007 UTC
# Line 15  Line 15 
15  #include "DataException.h"  #include "DataException.h"
16  #include "DataConstant.h"  #include "DataConstant.h"
17  #include "DataTagged.h"  #include "DataTagged.h"
18  #include <netcdfcpp.h>  #ifdef USE_NETCDF
19    #include "netcdfcpp.h"
20    #endif
21    
22  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
23    
# Line 616  DataExpanded::eigenvalues_and_eigenvecto Line 618  DataExpanded::eigenvalues_and_eigenvecto
618  }  }
619    
620  void  void
621    DataExpanded::setToZero(){
622      int numSamples = getNumSamples();
623      int numDataPointsPerSample = getNumDPPSample();
624      DataArrayView& thisView=getPointDataView();
625      DataArrayView::ValueType::size_type n = thisView.noValues();
626      double* p;
627      int  sampleNo,dataPointNo, i;
628      #pragma omp parallel for private(sampleNo,dataPointNo,p,i) schedule(static)
629      for (sampleNo = 0; sampleNo < numSamples; sampleNo++) {
630        for (dataPointNo = 0; dataPointNo < numDataPointsPerSample; dataPointNo++) {
631            p=&(m_data[getPointOffset(sampleNo,dataPointNo)]);
632            for (int i=0; i<n ;++i) p[i]=0.;
633        }
634      }
635    }
636    
637    
638    void
639  DataExpanded::dump(const std::string fileName) const  DataExpanded::dump(const std::string fileName) const
640  {  {
641     #ifdef PASO_MPI     #ifdef PASO_MPI
642     throw DataException("Error - DataExpanded:: dump is not implemented for MPI yet.");     throw DataException("Error - DataExpanded:: dump is not implemented for MPI yet.");
643     #endif     #endif
644       #ifdef USE_NETCDF
645     const int ldims=2+DataArrayView::maxRank;     const int ldims=2+DataArrayView::maxRank;
646     const NcDim* ncdims[ldims];     const NcDim* ncdims[ldims];
647     NcVar *var, *ids;     NcVar *var, *ids;
# Line 681  DataExpanded::dump(const std::string fil Line 702  DataExpanded::dump(const std::string fil
702          throw DataException("Error - DataExpanded:: appending variable to netCDF file failed.");          throw DataException("Error - DataExpanded:: appending variable to netCDF file failed.");
703     if (! (var->put(&m_data[0],dims)) )     if (! (var->put(&m_data[0],dims)) )
704          throw DataException("Error - DataExpanded:: copy data to netCDF buffer failed.");          throw DataException("Error - DataExpanded:: copy data to netCDF buffer failed.");
705       #else
706       throw DataException("Error - DataExpanded:: dump is not configured with netCDF. Please contact your installation manager.");
707       #endif
708  }  }
   
   
709  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.967  
changed lines
  Added in v.1131

  ViewVC Help
Powered by ViewVC 1.1.26