/[escript]/branches/arrexp_trunk2098/escript/src/DataExpanded.cpp
ViewVC logotype

Diff of /branches/arrexp_trunk2098/escript/src/DataExpanded.cpp

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

revision 2118 by jfenwick, Mon Dec 1 01:16:18 2008 UTC revision 2119 by jfenwick, Tue Dec 2 06:06:04 2008 UTC
# Line 46  DataExpanded::DataExpanded(const boost:: Line 46  DataExpanded::DataExpanded(const boost::
46    copy(value);    copy(value);
47  }  }
48    
49    DataExpanded::DataExpanded(const WrappedArray& value,
50                               const FunctionSpace& what)
51      : parent(what,value.getShape())
52    {
53      //
54      // initialise the data array for this object
55      initialise(what.getNumSamples(),what.getNumDPPSample());
56      //
57      // copy the given value to every data point
58      copy(value);
59    }
60    
61  DataExpanded::DataExpanded(const DataExpanded& other)  DataExpanded::DataExpanded(const DataExpanded& other)
62    : parent(other.getFunctionSpace(), other.getShape()),    : parent(other.getFunctionSpace(), other.getShape()),
63    m_data(other.m_data)    m_data(other.m_data)
# Line 264  DataExpanded::copy(const DataConstant& v Line 276  DataExpanded::copy(const DataConstant& v
276  }  }
277    
278    
 // void  
 // DataExpanded::copy(const DataArrayView& value)  
 // {  
 //   //  
 //   // copy a single value to every data point in this object  
 //   int nRows=m_data.getNumRows();  
 //   int nCols=m_data.getNumCols();  
 //   int i,j;  
 //   #pragma omp parallel for private(i,j) schedule(static)  
 //   for (i=0;i<nRows;i++) {  
 //     for (j=0;j<nCols;j++) {  
 //       // NOTE: An exception may be thown from this call if  
 //       // DOASSERT is on which of course will play  
 //       // havoc with the omp threads. Run single threaded  
 //       // if using DOASSERT.  
 //       getPointDataView().copy(getPointOffset(i,j),value);  
 //     }  
 //   }  
 // }  
279    
280  void  void
281  DataExpanded::copy(const boost::python::numeric::array& value)  DataExpanded::copy(const boost::python::numeric::array& value)
# Line 313  DataExpanded::copy(const boost::python:: Line 306  DataExpanded::copy(const boost::python::
306    getVector().copyFromNumArray(value);    getVector().copyFromNumArray(value);
307  }  }
308    
309    void
310    DataExpanded::copy(const WrappedArray& value)
311    {
312      // check the input shape matches this shape
313      if (!DataTypes::checkShape(getShape(),value.getShape())) {
314        throw DataException(DataTypes::createShapeErrorMessage(
315                            "Error - (DataExpanded) Cannot copy due to shape mismatch.",
316                            value.getShape(),getShape()));
317      }
318      getVector().copyFromArray(value);
319    }
320    
321    
322  void  void
323  DataExpanded::initialise(int noSamples,  DataExpanded::initialise(int noSamples,

Legend:
Removed from v.2118  
changed lines
  Added in v.2119

  ViewVC Help
Powered by ViewVC 1.1.26