/[escript]/trunk/escript/src/Data.h
ViewVC logotype

Diff of /trunk/escript/src/Data.h

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

revision 922 by gross, Fri Jan 5 04:23:05 2007 UTC revision 1141 by gross, Tue May 15 04:24:51 2007 UTC
# Line 254  class Data { Line 254  class Data {
254    ESCRIPT_DLL_API    ESCRIPT_DLL_API
255    bool    bool
256    isProtected() const;    isProtected() const;
257    
258    /**    /**
259       \brief       \brief
260       Return the values of all data-points as a single python numarray object.       Return the values of a data point on this process
261    */    */
262    ESCRIPT_DLL_API    ESCRIPT_DLL_API
263    const boost::python::numeric::array    const boost::python::numeric::array
264    convertToNumArray();    getValueOfDataPoint(int dataPointNo);
265    
266    /**    /**
267       \brief       \brief
268       Fills the expanded Data object from values of a python numarray object.       sets the values of a data-point from a python object on this process
269    */    */
270    ESCRIPT_DLL_API    ESCRIPT_DLL_API
271    void    void
272    fillFromNumArray(const boost::python::numeric::array);    setValueOfDataPointToPyObject(int dataPointNo, const boost::python::object& py_object);
   
   /**  
      \brief  
      Return the values of a data point on this process  
   */  
   ESCRIPT_DLL_API  
   const boost::python::numeric::array  
   getValueOfDataPoint(int dataPointNo);  
273    
274    /**    /**
275       \brief       \brief
276       sets the values of a data-point on this process       sets the values of a data-point from a numarray object on this process
277    */    */
278    ESCRIPT_DLL_API    ESCRIPT_DLL_API
279    void    void
280    setValueOfDataPointToArray(int dataPointNo, const boost::python::numeric::array);    setValueOfDataPointToArray(int dataPointNo, const boost::python::numeric::array&);
281    
282    /**    /**
283       \brief       \brief
# Line 340  class Data { Line 333  class Data {
333    {    {
334      return m_data->toString();      return m_data->toString();
335    }    }
336      
337      /**
338         \brief
339         Return a description for this domain for python.
340      */
341      ESCRIPT_DLL_API
342      const boost::python::str str() const;
343    
344    /**    /**
345       \brief       \brief
# Line 492  class Data { Line 492  class Data {
492    {    {
493      return m_data->getNumDPPSample();      return m_data->getNumDPPSample();
494    }    }
495      /**
496         \brief
497         dumps the object into a netCDF file
498      */
499      ESCRIPT_DLL_API
500      void
501      dump(const std::string fileName) const;
502    /**    /**
503       \brief       \brief
504       Return the sample data for the given sample no. This is not the       Return the sample data for the given sample no. This is not the
# Line 523  class Data { Line 529  class Data {
529    
530    /**    /**
531       \brief       \brief
      Assign the given value to the data-points referenced by the given  
      reference number.  
   
      The value supplied is a python numarray object.  The data from this numarray  
      is unpacked into a DataArray, and this is used to set the corresponding  
      data-points in the underlying Data object.  
   
      If the underlying Data object cannot be accessed via reference numbers, an  
      exception will be thrown.  
   
      \param ref - Input - reference number.  
      \param value - Input - value to assign to data-points associated with  
                             the given reference number.  
   */  
   ESCRIPT_DLL_API  
   void  
   setRefValue(int ref,  
               const boost::python::numeric::array& value);  
   
   /**  
      \brief  
      Return the values associated with the data-points referenced by the given  
      reference number.  
   
      The value supplied is a python numarray object. The data from the corresponding  
      data-points in this Data object are packed into the given numarray object.  
   
      If the underlying Data object cannot be accessed via reference numbers, an  
      exception will be thrown.  
   
      \param ref - Input - reference number.  
      \param value - Output - object to receive values from data-points  
                              associated with the given reference number.  
   */  
   ESCRIPT_DLL_API  
   void  
   getRefValue(int ref,  
               boost::python::numeric::array& value);  
   
   /**  
      \brief  
532       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
533       NOTE: Construction of the DataArrayView is a relatively expensive       NOTE: Construction of the DataArrayView is a relatively expensive
534       operation.       operation.
# Line 612  class Data { Line 577  class Data {
577    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
578    getLength() const;    getLength() const;
579    
580    
581    
582      /**
583         \brief
584         Assign the given value to the tag assocciated with name. Implicitly converts this
585         object to type DataTagged. Throws an exception if this object
586         cannot be converted to a DataTagged object or name cannot be mapped onto a tag key.
587         \param tagKey - Input - Integer key.
588         \param value - Input - Value to associate with given key.
589        ==>*
590      */
591      ESCRIPT_DLL_API
592      void
593      setTaggedValueByName(std::string name,
594                           const boost::python::object& value);
595    
596    /**    /**
597       \brief       \brief
598       Assign the given value to the tag. Implicitly converts this       Assign the given value to the tag. Implicitly converts this
# Line 655  class Data { Line 636  class Data {
636    
637    /**    /**
638       \brief       \brief
639         set all values to zero
640         *
641      */
642      ESCRIPT_DLL_API
643      void
644      setToZero();
645    
646      /**
647         \brief
648       Interpolates this onto the given functionspace and returns       Interpolates this onto the given functionspace and returns
649       the result as a Data object.       the result as a Data object.
650       *       *
# Line 662  class Data { Line 652  class Data {
652    ESCRIPT_DLL_API    ESCRIPT_DLL_API
653    Data    Data
654    interpolate(const FunctionSpace& functionspace) const;    interpolate(const FunctionSpace& functionspace) const;
   
655    /**    /**
656       \brief       \brief
657       Calculates the gradient of the data at the data points of functionspace.       Calculates the gradient of the data at the data points of functionspace.
# Line 1409  class Data { Line 1398  class Data {
1398    // pointer to the actual data object    // pointer to the actual data object
1399    boost::shared_ptr<DataAbstract> m_data;    boost::shared_ptr<DataAbstract> m_data;
1400    
   //  
   // pointer to the internal profiling data  
   struct profDataEntry *profData;  
   
1401  };  };
1402    
1403  template <class IValueType>  template <class IValueType>
# Line 1443  Data::initialise(const IValueType& value Line 1428  Data::initialise(const IValueType& value
1428  inline double rpow(double x,double y)  inline double rpow(double x,double y)
1429  {  {
1430      return pow(y,x);      return pow(y,x);
1431  };  }
1432    
1433  /**  /**
1434    \brief    \brief
# Line 1632  Data::binaryOp(const Data& right, Line 1617  Data::binaryOp(const Data& right,
1617       EsysAssert((leftC!=0 && rightC!=0), "Programming error - casting to DataConstant.");       EsysAssert((leftC!=0 && rightC!=0), "Programming error - casting to DataConstant.");
1618       escript::binaryOp(*leftC,*rightC,operation);       escript::binaryOp(*leftC,*rightC,operation);
1619     }     }
    #if defined DOPROF  
    profData->binary++;  
    #endif  
1620  }  }
1621    
1622  /**  /**

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

  ViewVC Help
Powered by ViewVC 1.1.26