/[escript]/branches/schroedinger/escript/src/Data.h
ViewVC logotype

Diff of /branches/schroedinger/escript/src/Data.h

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

revision 698 by gross, Fri Mar 31 04:52:55 2006 UTC revision 921 by gross, Fri Jan 5 00:54:37 2007 UTC
# Line 15  Line 15 
15    
16  #ifndef DATA_H  #ifndef DATA_H
17  #define DATA_H  #define DATA_H
18    #include "system_dep.h"
19    
20  #include "DataAbstract.h"  #include "DataAbstract.h"
21  #include "DataAlgorithm.h"  #include "DataAlgorithm.h"
# Line 25  Line 26 
26    
27  extern "C" {  extern "C" {
28  #include "DataC.h"  #include "DataC.h"
29    #include "paso/Paso.h"
30  }  }
31    
32    #ifndef PASO_MPI
33    #define MPI_Comm long
34    #endif
35    
36  #include <string>  #include <string>
37  #include <algorithm>  #include <algorithm>
38    
# Line 64  class Data { Line 70  class Data {
70    typedef double (*UnaryDFunPtr)(double);    typedef double (*UnaryDFunPtr)(double);
71    typedef double (*BinaryDFunPtr)(double,double);    typedef double (*BinaryDFunPtr)(double,double);
72    
73    
74    /**    /**
75       Constructors.       Constructors.
76    */    */
# Line 73  class Data { Line 80  class Data {
80       Default constructor.       Default constructor.
81       Creates a DataEmpty object.       Creates a DataEmpty object.
82    */    */
83      ESCRIPT_DLL_API
84    Data();    Data();
85    
86    /**    /**
# Line 80  class Data { Line 88  class Data {
88       Copy constructor.       Copy constructor.
89       WARNING: Only performs a shallow copy.       WARNING: Only performs a shallow copy.
90    */    */
91      ESCRIPT_DLL_API
92    Data(const Data& inData);    Data(const Data& inData);
93    
94    /**    /**
# Line 88  class Data { Line 97  class Data {
97       function space of inData the inData are tried to be interpolated to what,       function space of inData the inData are tried to be interpolated to what,
98       otherwise a shallow copy of inData is returned.       otherwise a shallow copy of inData is returned.
99    */    */
100      ESCRIPT_DLL_API
101    Data(const Data& inData,    Data(const Data& inData,
102         const FunctionSpace& what);         const FunctionSpace& what);
103    
# Line 101  class Data { Line 111  class Data {
111                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
112                         mechanism will be used.                         mechanism will be used.
113    */    */
114      ESCRIPT_DLL_API
115    Data(const DataArrayView& value,    Data(const DataArrayView& value,
116         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
117         bool expanded=false);         bool expanded=false);
# Line 116  class Data { Line 127  class Data {
127                         the given value. Otherwise a more efficient storage                         the given value. Otherwise a more efficient storage
128                         mechanism will be used.                         mechanism will be used.
129    */    */
130      ESCRIPT_DLL_API
131    Data(double value,    Data(double value,
132         const DataArrayView::ShapeType& dataPointShape=DataArrayView::ShapeType(),         const DataArrayView::ShapeType& dataPointShape=DataArrayView::ShapeType(),
133         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
# Line 128  class Data { Line 140  class Data {
140       \param inData - Input - Input Data object.       \param inData - Input - Input Data object.
141       \param region - Input - Region to copy.       \param region - Input - Region to copy.
142    */    */
143      ESCRIPT_DLL_API
144    Data(const Data& inData,    Data(const Data& inData,
145         const DataArrayView::RegionType& region);         const DataArrayView::RegionType& region);
146    
# Line 145  class Data { Line 158  class Data {
158                         the appropriate values.                         the appropriate values.
159      ==>*      ==>*
160    */    */
161      ESCRIPT_DLL_API
162    Data(const DataTagged::TagListType& tagKeys,    Data(const DataTagged::TagListType& tagKeys,
163         const DataTagged::ValueListType& values,         const DataTagged::ValueListType& values,
164         const DataArrayView& defaultValue,         const DataArrayView& defaultValue,
# Line 161  class Data { Line 175  class Data {
175                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
176                         mechanism will be used.                         mechanism will be used.
177    */    */
178      ESCRIPT_DLL_API
179    Data(const boost::python::numeric::array& value,    Data(const boost::python::numeric::array& value,
180         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
181         bool expanded=false);         bool expanded=false);
# Line 176  class Data { Line 191  class Data {
191                         the value. Otherwise a more efficient storage                         the value. Otherwise a more efficient storage
192                         mechanism will be used.                         mechanism will be used.
193    */    */
194      ESCRIPT_DLL_API
195    Data(const boost::python::object& value,    Data(const boost::python::object& value,
196         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
197         bool expanded=false);         bool expanded=false);
# Line 189  class Data { Line 205  class Data {
205       \param value - Input - Input data.       \param value - Input - Input data.
206       \param other - Input - contains all other parameters.       \param other - Input - contains all other parameters.
207    */    */
208      ESCRIPT_DLL_API
209    Data(const boost::python::object& value,    Data(const boost::python::object& value,
210         const Data& other);         const Data& other);
211    
# Line 196  class Data { Line 213  class Data {
213       \brief       \brief
214       Constructor which creates a DataConstant of "shape" with constant value.       Constructor which creates a DataConstant of "shape" with constant value.
215    */    */
216      ESCRIPT_DLL_API
217    Data(double value,    Data(double value,
218         const boost::python::tuple& shape=boost::python::make_tuple(),         const boost::python::tuple& shape=boost::python::make_tuple(),
219         const FunctionSpace& what=FunctionSpace(),         const FunctionSpace& what=FunctionSpace(),
# Line 204  class Data { Line 222  class Data {
222       \brief       \brief
223       Destructor       Destructor
224    */    */
225      ESCRIPT_DLL_API
226    ~Data();    ~Data();
227    
228    /**    /**
229       \brief       \brief
230       Perform a deep copy.       Perform a deep copy.
231    */    */
232      ESCRIPT_DLL_API
233    void    void
234    copy(const Data& other);    copy(const Data& other);
235    
# Line 219  class Data { Line 239  class Data {
239    
240    /**    /**
241       \brief       \brief
242         switches on update protection
243    
244      */
245      ESCRIPT_DLL_API
246      void
247      setProtection();
248    
249      /**
250         \brief
251         Returns trueif the data object is protected against update
252    
253      */
254      ESCRIPT_DLL_API
255      bool
256      isProtected() const;
257      /**
258         \brief
259       Return the values of all data-points as a single python numarray object.       Return the values of all data-points as a single python numarray object.
260    */    */
261      ESCRIPT_DLL_API
262    const boost::python::numeric::array    const boost::python::numeric::array
263    convertToNumArray();    convertToNumArray();
264    
265    /**    /**
266       \brief       \brief
267       Return the values of all data-points for the given sample as a single python numarray object.       Fills the expanded Data object from values of a python numarray object.
268    */    */
269    const boost::python::numeric::array    ESCRIPT_DLL_API
270    convertToNumArrayFromSampleNo(int sampleNo);    void
271      fillFromNumArray(const boost::python::numeric::array);
272    
273    /**    /**
274       \brief       \brief
275       Return the value of the specified data-point as a single python numarray object.       Return the values of a data point on this process
276    */    */
277      ESCRIPT_DLL_API
278    const boost::python::numeric::array    const boost::python::numeric::array
279    convertToNumArrayFromDPNo(int sampleNo,    getValueOfDataPoint(int dataPointNo);
                             int dataPointNo);  
280    
281    /**    /**
282       \brief       \brief
283       Fills the expanded Data object from values of a python numarray object.       sets the values of a data-point on this process
284    */    */
285      ESCRIPT_DLL_API
286    void    void
287    fillFromNumArray(const boost::python::numeric::array);    setValueOfDataPoint(int dataPointNo, const boost::python::numeric::array);
288    
289      /**
290         \brief
291         Return the value of the specified data-point across all processors
292      */
293      ESCRIPT_DLL_API
294      const boost::python::numeric::array
295      getValueOfGlobalDataPoint(int procNo, int dataPointNo);
296    
297    /**    /**
298       \brief       \brief
# Line 253  class Data { Line 301  class Data {
301       The data-point number here corresponds to the data-point number in the       The data-point number here corresponds to the data-point number in the
302       numarray returned by convertToNumArray.       numarray returned by convertToNumArray.
303    */    */
304      ESCRIPT_DLL_API
305    int    int
306    getTagNumber(int dpno);    getTagNumber(int dpno);
307    
# Line 260  class Data { Line 309  class Data {
309       \brief       \brief
310       Return the C wrapper for the Data object.       Return the C wrapper for the Data object.
311    */    */
312      ESCRIPT_DLL_API
313    escriptDataC    escriptDataC
314    getDataC();    getDataC();
315    
# Line 267  class Data { Line 317  class Data {
317       \brief       \brief
318       Return the C wrapper for the Data object - const version.       Return the C wrapper for the Data object - const version.
319    */    */
320      ESCRIPT_DLL_API
321    escriptDataC    escriptDataC
322    getDataC() const;    getDataC() const;
323    
# Line 274  class Data { Line 325  class Data {
325       \brief       \brief
326       Write the data as a string.       Write the data as a string.
327    */    */
328      ESCRIPT_DLL_API
329    inline    inline
330    std::string    std::string
331    toString() const    toString() const
# Line 287  class Data { Line 339  class Data {
339       the shape information for each data point although it also may be used       the shape information for each data point although it also may be used
340       to manipulate the point data.       to manipulate the point data.
341    */    */
342      ESCRIPT_DLL_API
343    inline    inline
344    const DataArrayView&    const DataArrayView&
345    getPointDataView() const    getPointDataView() const
# Line 298  class Data { Line 351  class Data {
351       \brief       \brief
352       Whatever the current Data type make this into a DataExpanded.       Whatever the current Data type make this into a DataExpanded.
353    */    */
354      ESCRIPT_DLL_API
355    void    void
356    expand();    expand();
357    
# Line 308  class Data { Line 362  class Data {
362       Expanded data to tagged will throw an exception.       Expanded data to tagged will throw an exception.
363      ==>*      ==>*
364    */    */
365      ESCRIPT_DLL_API
366    void    void
367    tag();    tag();
368    
# Line 315  class Data { Line 370  class Data {
370       \brief       \brief
371       Return true if this Data is expanded.       Return true if this Data is expanded.
372    */    */
373      ESCRIPT_DLL_API
374    bool    bool
375    isExpanded() const;    isExpanded() const;
376    
# Line 322  class Data { Line 378  class Data {
378       \brief       \brief
379       Return true if this Data is tagged.       Return true if this Data is tagged.
380    */    */
381      ESCRIPT_DLL_API
382    bool    bool
383    isTagged() const;    isTagged() const;
384    
# Line 329  class Data { Line 386  class Data {
386       \brief       \brief
387       Return true if this Data is constant.       Return true if this Data is constant.
388    */    */
389      ESCRIPT_DLL_API
390    bool    bool
391    isConstant() const;    isConstant() const;
392    
# Line 336  class Data { Line 394  class Data {
394       \brief       \brief
395       Return true if this Data is empty.       Return true if this Data is empty.
396    */    */
397      ESCRIPT_DLL_API
398    bool    bool
399    isEmpty() const;    isEmpty() const;
400    
# Line 343  class Data { Line 402  class Data {
402       \brief       \brief
403       Return the function space.       Return the function space.
404    */    */
405      ESCRIPT_DLL_API
406    inline    inline
407    const FunctionSpace&    const FunctionSpace&
408    getFunctionSpace() const    getFunctionSpace() const
# Line 354  class Data { Line 414  class Data {
414       \brief       \brief
415       Return a copy of the function space.       Return a copy of the function space.
416    */    */
417      ESCRIPT_DLL_API
418    const FunctionSpace    const FunctionSpace
419    getCopyOfFunctionSpace() const;    getCopyOfFunctionSpace() const;
420    
# Line 361  class Data { Line 422  class Data {
422       \brief       \brief
423       Return the domain.       Return the domain.
424    */    */
425      ESCRIPT_DLL_API
426    inline    inline
427    const AbstractDomain&    const AbstractDomain&
428    getDomain() const    getDomain() const
# Line 372  class Data { Line 434  class Data {
434       \brief       \brief
435       Return a copy of the domain.       Return a copy of the domain.
436    */    */
437      ESCRIPT_DLL_API
438    const AbstractDomain    const AbstractDomain
439    getCopyOfDomain() const;    getCopyOfDomain() const;
440    
# Line 379  class Data { Line 442  class Data {
442       \brief       \brief
443       Return the rank of the point data.       Return the rank of the point data.
444    */    */
445      ESCRIPT_DLL_API
446    inline    inline
447    int    int
448    getDataPointRank() const    getDataPointRank() const
# Line 388  class Data { Line 452  class Data {
452    
453    /**    /**
454       \brief       \brief
455         Return the number of data points
456      */
457      ESCRIPT_DLL_API
458      inline
459      int
460      getNumDataPoints() const
461      {
462        return getNumSamples() * getNumDataPointsPerSample();
463      }
464      /**
465         \brief
466       Return the number of samples.       Return the number of samples.
467    */    */
468      ESCRIPT_DLL_API
469    inline    inline
470    int    int
471    getNumSamples() const    getNumSamples() const
# Line 401  class Data { Line 477  class Data {
477       \brief       \brief
478       Return the number of data points per sample.       Return the number of data points per sample.
479    */    */
480      ESCRIPT_DLL_API
481    inline    inline
482    int    int
483    getNumDataPointsPerSample() const    getNumDataPointsPerSample() const
# Line 414  class Data { Line 491  class Data {
491       preferred interface but is provided for use by C code.       preferred interface but is provided for use by C code.
492       \param sampleNo - Input - the given sample no.       \param sampleNo - Input - the given sample no.
493    */    */
494      ESCRIPT_DLL_API
495    inline    inline
496    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
497    getSampleData(DataAbstract::ValueType::size_type sampleNo)    getSampleData(DataAbstract::ValueType::size_type sampleNo)
# Line 427  class Data { Line 505  class Data {
505       access data that isn't tagged an exception will be thrown.       access data that isn't tagged an exception will be thrown.
506       \param tag - Input - the tag key.       \param tag - Input - the tag key.
507    */    */
508      ESCRIPT_DLL_API
509    inline    inline
510    DataAbstract::ValueType::value_type*    DataAbstract::ValueType::value_type*
511    getSampleDataByTag(int tag)    getSampleDataByTag(int tag)
# Line 450  class Data { Line 529  class Data {
529       \param value - Input - value to assign to data-points associated with       \param value - Input - value to assign to data-points associated with
530                              the given reference number.                              the given reference number.
531    */    */
532      ESCRIPT_DLL_API
533    void    void
534    setRefValue(int ref,    setRefValue(int ref,
535                const boost::python::numeric::array& value);                const boost::python::numeric::array& value);
# Line 469  class Data { Line 549  class Data {
549       \param value - Output - object to receive values from data-points       \param value - Output - object to receive values from data-points
550                               associated with the given reference number.                               associated with the given reference number.
551    */    */
552      ESCRIPT_DLL_API
553    void    void
554    getRefValue(int ref,    getRefValue(int ref,
555                boost::python::numeric::array& value);                boost::python::numeric::array& value);
# Line 481  class Data { Line 562  class Data {
562       \param sampleNo - Input -       \param sampleNo - Input -
563       \param dataPointNo - Input -       \param dataPointNo - Input -
564    */    */
565      ESCRIPT_DLL_API
566    inline    inline
567    DataArrayView    DataArrayView
568    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
569                 int dataPointNo)                 int dataPointNo)
570    {    {
571      return m_data->getDataPoint(sampleNo,dataPointNo);          return m_data->getDataPoint(sampleNo,dataPointNo);
572    }    }
573    
574    /**    /**
575       \brief       \brief
576       Return a reference to the data point shape.       Return a reference to the data point shape.
577    */    */
578      ESCRIPT_DLL_API
579    const DataArrayView::ShapeType&    const DataArrayView::ShapeType&
580    getDataPointShape() const;    getDataPointShape() const;
581    
# Line 500  class Data { Line 583  class Data {
583       \brief       \brief
584       Return the data point shape as a tuple of integers.       Return the data point shape as a tuple of integers.
585    */    */
586      ESCRIPT_DLL_API
587    const boost::python::tuple    const boost::python::tuple
588    getShapeTuple() const;    getShapeTuple() const;
589    
# Line 508  class Data { Line 592  class Data {
592       Return the size of the data point. It is the product of the       Return the size of the data point. It is the product of the
593       data point shape dimensions.       data point shape dimensions.
594    */    */
595      ESCRIPT_DLL_API
596    int    int
597    getDataPointSize() const;    getDataPointSize() const;
598    
# Line 515  class Data { Line 600  class Data {
600       \brief       \brief
601       Return the number of doubles stored for this Data.       Return the number of doubles stored for this Data.
602    */    */
603      ESCRIPT_DLL_API
604    DataArrayView::ValueType::size_type    DataArrayView::ValueType::size_type
605    getLength() const;    getLength() const;
606    
# Line 527  class Data { Line 613  class Data {
613       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
614      ==>*      ==>*
615    */    */
616      ESCRIPT_DLL_API
617    void    void
618    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
619                   const boost::python::object& value);                   const boost::python::object& value);
# Line 540  class Data { Line 627  class Data {
627       \param value - Input - Value to associate with given key.       \param value - Input - Value to associate with given key.
628      ==>*      ==>*
629    */    */
630      ESCRIPT_DLL_API
631    void    void
632    setTaggedValueFromCPP(int tagKey,    setTaggedValueFromCPP(int tagKey,
633                          const DataArrayView& value);                          const DataArrayView& value);
# Line 548  class Data { Line 636  class Data {
636      \brief      \brief
637      Copy other Data object into this Data object where mask is positive.      Copy other Data object into this Data object where mask is positive.
638    */    */
639      ESCRIPT_DLL_API
640    void    void
641    copyWithMask(const Data& other,    copyWithMask(const Data& other,
642                 const Data& mask);                 const Data& mask);
# Line 562  class Data { Line 651  class Data {
651       the result as a Data object.       the result as a Data object.
652       *       *
653    */    */
654      ESCRIPT_DLL_API
655    Data    Data
656    interpolate(const FunctionSpace& functionspace) const;    interpolate(const FunctionSpace& functionspace) const;
657    
# Line 571  class Data { Line 661  class Data {
661       If functionspace is not present the function space of Function(getDomain()) is used.       If functionspace is not present the function space of Function(getDomain()) is used.
662       *       *
663    */    */
664      ESCRIPT_DLL_API
665    Data    Data
666    gradOn(const FunctionSpace& functionspace) const;    gradOn(const FunctionSpace& functionspace) const;
667    
668      ESCRIPT_DLL_API
669    Data    Data
670    grad() const;    grad() const;
671    
# Line 582  class Data { Line 674  class Data {
674       Calculate the integral over the function space domain.       Calculate the integral over the function space domain.
675       *       *
676    */    */
677      ESCRIPT_DLL_API
678    boost::python::numeric::array    boost::python::numeric::array
679    integrate() const;    integrate() const;
680    
681    /**    /**
682       \brief       \brief
683         Returns 1./ Data object
684         *
685      */
686      ESCRIPT_DLL_API
687      Data
688      oneOver() const;
689      /**
690         \brief
691       Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.       Return a Data with a 1 for +ive values and a 0 for 0 or -ive values.
692       *       *
693    */    */
694      ESCRIPT_DLL_API
695    Data    Data
696    wherePositive() const;    wherePositive() const;
697    
# Line 598  class Data { Line 700  class Data {
700       Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.       Return a Data with a 1 for -ive values and a 0 for +ive or 0 values.
701       *       *
702    */    */
703      ESCRIPT_DLL_API
704    Data    Data
705    whereNegative() const;    whereNegative() const;
706    
# Line 606  class Data { Line 709  class Data {
709       Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.       Return a Data with a 1 for +ive or 0 values and a 0 for -ive values.
710       *       *
711    */    */
712      ESCRIPT_DLL_API
713    Data    Data
714    whereNonNegative() const;    whereNonNegative() const;
715    
# Line 614  class Data { Line 718  class Data {
718       Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.       Return a Data with a 1 for -ive or 0 values and a 0 for +ive values.
719       *       *
720    */    */
721      ESCRIPT_DLL_API
722    Data    Data
723    whereNonPositive() const;    whereNonPositive() const;
724    
# Line 622  class Data { Line 727  class Data {
727       Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.       Return a Data with a 1 for 0 values and a 0 for +ive or -ive values.
728       *       *
729    */    */
730      ESCRIPT_DLL_API
731    Data    Data
732    whereZero(double tol=0.0) const;    whereZero(double tol=0.0) const;
733    
# Line 630  class Data { Line 736  class Data {
736       Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.       Return a Data with a 0 for 0 values and a 1 for +ive or -ive values.
737       *       *
738    */    */
739      ESCRIPT_DLL_API
740    Data    Data
741    whereNonZero(double tol=0.0) const;    whereNonZero(double tol=0.0) const;
742    
# Line 638  class Data { Line 745  class Data {
745       Return the maximum absolute value of this Data object.       Return the maximum absolute value of this Data object.
746       *       *
747    */    */
748      ESCRIPT_DLL_API
749    double    double
750    Lsup() const;    Lsup() const;
751    
# Line 646  class Data { Line 754  class Data {
754       Return the minimum absolute value of this Data object.       Return the minimum absolute value of this Data object.
755       *       *
756    */    */
757      ESCRIPT_DLL_API
758    double    double
759    Linf() const;    Linf() const;
760    
# Line 654  class Data { Line 763  class Data {
763       Return the maximum value of this Data object.       Return the maximum value of this Data object.
764       *       *
765    */    */
766      ESCRIPT_DLL_API
767    double    double
768    sup() const;    sup() const;
769    
# Line 662  class Data { Line 772  class Data {
772       Return the minimum value of this Data object.       Return the minimum value of this Data object.
773       *       *
774    */    */
775      ESCRIPT_DLL_API
776    double    double
777    inf() const;    inf() const;
778    
# Line 670  class Data { Line 781  class Data {
781       Return the absolute value of each data point of this Data object.       Return the absolute value of each data point of this Data object.
782       *       *
783    */    */
784      ESCRIPT_DLL_API
785    Data    Data
786    abs() const;    abs() const;
787    
# Line 678  class Data { Line 790  class Data {
790       Return the maximum value of each data point of this Data object.       Return the maximum value of each data point of this Data object.
791       *       *
792    */    */
793      ESCRIPT_DLL_API
794    Data    Data
795    maxval() const;    maxval() const;
796    
# Line 686  class Data { Line 799  class Data {
799       Return the minimum value of each data point of this Data object.       Return the minimum value of each data point of this Data object.
800       *       *
801    */    */
802      ESCRIPT_DLL_API
803    Data    Data
804    minval() const;    minval() const;
805    
# Line 694  class Data { Line 808  class Data {
808       Return the (sample number, data-point number) of the data point with       Return the (sample number, data-point number) of the data point with
809       the minimum value in this Data object.       the minimum value in this Data object.
810    */    */
811      ESCRIPT_DLL_API
812    const boost::python::tuple    const boost::python::tuple
813    mindp() const;    minGlobalDataPoint() const;
814    
815      ESCRIPT_DLL_API
816    void    void
817    calc_mindp(int& SampleNo,    calc_minGlobalDataPoint(int& ProcNo,  int& DataPointNo) const;
              int& DataPointNo) const;  
   
818    /**    /**
819       \brief       \brief
820       Return the sign of each data point of this Data object.       Return the sign of each data point of this Data object.
821       -1 for negative values, zero for zero values, 1 for positive values.       -1 for negative values, zero for zero values, 1 for positive values.
822       *       *
823    */    */
824      ESCRIPT_DLL_API
825    Data    Data
826    sign() const;    sign() const;
827    
828    /**    /**
829       \brief       \brief
830         Return the symmetric part of a matrix which is half the matrix plus its transpose.
831         *
832      */
833      ESCRIPT_DLL_API
834      Data
835      symmetric() const;
836    
837      /**
838         \brief
839         Return the nonsymmetric part of a matrix which is half the matrix minus its transpose.
840         *
841      */
842      ESCRIPT_DLL_API
843      Data
844      nonsymmetric() const;
845    
846      /**
847         \brief
848         Return the trace of a matrix
849         *
850      */
851      ESCRIPT_DLL_API
852      Data
853      trace(int axis_offset) const;
854    
855      /**
856         \brief
857         Transpose each data point of this Data object around the given axis.
858         *
859      */
860      ESCRIPT_DLL_API
861      Data
862      transpose(int axis_offset) const;
863    
864      /**
865         \brief
866       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.
867       Currently this function is restricted to rank 2, square shape, and dimension 3.       Currently this function is restricted to rank 2, square shape, and dimension 3.
868       *       *
869    */    */
870      ESCRIPT_DLL_API
871    Data    Data
872    eigenvalues() const;    eigenvalues() const;
873    
# Line 728  class Data { Line 880  class Data {
880       Currently this function is restricted to rank 2, square shape, and dimension 3       Currently this function is restricted to rank 2, square shape, and dimension 3
881       *       *
882    */    */
883      ESCRIPT_DLL_API
884    const boost::python::tuple    const boost::python::tuple
885    eigenvalues_and_eigenvectors(const double tol=1.e-12) const;    eigenvalues_and_eigenvectors(const double tol=1.e-12) const;
886    
887    /**    /**
888       \brief       \brief
889       Transpose each data point of this Data object around the given axis.       swaps the components axis0 and axis1
      --* not implemented yet *--  
890       *       *
891    */    */
892      ESCRIPT_DLL_API
893    Data    Data
894    transpose(int axis) const;    swapaxes(const int axis0, const int axis1) const;
895    
896    /**    /**
897       \brief       \brief
898       Calculate the trace of each data point of this Data object.       Return the error function erf of each data point of this Data object.
899       *       *
900    */    */
901      ESCRIPT_DLL_API
902    Data    Data
903    trace() const;    erf() const;
904    
905    /**    /**
906       \brief       \brief
907       Return the sin of each data point of this Data object.       Return the sin of each data point of this Data object.
908       *       *
909    */    */
910      ESCRIPT_DLL_API
911    Data    Data
912    sin() const;    sin() const;
913    
# Line 761  class Data { Line 916  class Data {
916       Return the cos of each data point of this Data object.       Return the cos of each data point of this Data object.
917       *       *
918    */    */
919      ESCRIPT_DLL_API
920    Data    Data
921    cos() const;    cos() const;
922    
# Line 769  class Data { Line 925  class Data {
925       Return the tan of each data point of this Data object.       Return the tan of each data point of this Data object.
926       *       *
927    */    */
928      ESCRIPT_DLL_API
929    Data    Data
930    tan() const;    tan() const;
931    
# Line 777  class Data { Line 934  class Data {
934       Return the asin of each data point of this Data object.       Return the asin of each data point of this Data object.
935       *       *
936    */    */
937      ESCRIPT_DLL_API
938    Data    Data
939    asin() const;    asin() const;
940    
# Line 785  class Data { Line 943  class Data {
943       Return the acos of each data point of this Data object.       Return the acos of each data point of this Data object.
944       *       *
945    */    */
946      ESCRIPT_DLL_API
947    Data    Data
948    acos() const;    acos() const;
949    
# Line 793  class Data { Line 952  class Data {
952       Return the atan of each data point of this Data object.       Return the atan of each data point of this Data object.
953       *       *
954    */    */
955      ESCRIPT_DLL_API
956    Data    Data
957    atan() const;    atan() const;
958    
# Line 801  class Data { Line 961  class Data {
961       Return the sinh of each data point of this Data object.       Return the sinh of each data point of this Data object.
962       *       *
963    */    */
964      ESCRIPT_DLL_API
965    Data    Data
966    sinh() const;    sinh() const;
967    
# Line 809  class Data { Line 970  class Data {
970       Return the cosh of each data point of this Data object.       Return the cosh of each data point of this Data object.
971       *       *
972    */    */
973      ESCRIPT_DLL_API
974    Data    Data
975    cosh() const;    cosh() const;
976    
# Line 817  class Data { Line 979  class Data {
979       Return the tanh of each data point of this Data object.       Return the tanh of each data point of this Data object.
980       *       *
981    */    */
982      ESCRIPT_DLL_API
983    Data    Data
984    tanh() const;    tanh() const;
985    
# Line 825  class Data { Line 988  class Data {
988       Return the asinh of each data point of this Data object.       Return the asinh of each data point of this Data object.
989       *       *
990    */    */
991      ESCRIPT_DLL_API
992    Data    Data
993    asinh() const;    asinh() const;
994    
# Line 833  class Data { Line 997  class Data {
997       Return the acosh of each data point of this Data object.       Return the acosh of each data point of this Data object.
998       *       *
999    */    */
1000      ESCRIPT_DLL_API
1001    Data    Data
1002    acosh() const;    acosh() const;
1003    
# Line 841  class Data { Line 1006  class Data {
1006       Return the atanh of each data point of this Data object.       Return the atanh of each data point of this Data object.
1007       *       *
1008    */    */
1009      ESCRIPT_DLL_API
1010    Data    Data
1011    atanh() const;    atanh() const;
1012    
# Line 849  class Data { Line 1015  class Data {
1015       Return the log to base 10 of each data point of this Data object.       Return the log to base 10 of each data point of this Data object.
1016       *       *
1017    */    */
1018      ESCRIPT_DLL_API
1019    Data    Data
1020    log10() const;    log10() const;
1021    
# Line 857  class Data { Line 1024  class Data {
1024       Return the natural log of each data point of this Data object.       Return the natural log of each data point of this Data object.
1025       *       *
1026    */    */
1027      ESCRIPT_DLL_API
1028    Data    Data
1029    log() const;    log() const;
1030    
# Line 865  class Data { Line 1033  class Data {
1033       Return the exponential function of each data point of this Data object.       Return the exponential function of each data point of this Data object.
1034       *       *
1035    */    */
1036      ESCRIPT_DLL_API
1037    Data    Data
1038    exp() const;    exp() const;
1039    
# Line 873  class Data { Line 1042  class Data {
1042       Return the square root of each data point of this Data object.       Return the square root of each data point of this Data object.
1043       *       *
1044    */    */
1045      ESCRIPT_DLL_API
1046    Data    Data
1047    sqrt() const;    sqrt() const;
1048    
# Line 881  class Data { Line 1051  class Data {
1051       Return the negation of each data point of this Data object.       Return the negation of each data point of this Data object.
1052       *       *
1053    */    */
1054      ESCRIPT_DLL_API
1055    Data    Data
1056    neg() const;    neg() const;
1057    
# Line 890  class Data { Line 1061  class Data {
1061       Simply returns this object unmodified.       Simply returns this object unmodified.
1062       *       *
1063    */    */
1064      ESCRIPT_DLL_API
1065    Data    Data
1066    pos() const;    pos() const;
1067    
# Line 900  class Data { Line 1072  class Data {
1072       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1073       *       *
1074    */    */
1075      ESCRIPT_DLL_API
1076    Data    Data
1077    powD(const Data& right) const;    powD(const Data& right) const;
1078    
# Line 910  class Data { Line 1083  class Data {
1083       \param right Input - the power to raise the object to.       \param right Input - the power to raise the object to.
1084       *       *
1085     */     */
1086      ESCRIPT_DLL_API
1087    Data    Data
1088    powO(const boost::python::object& right) const;    powO(const boost::python::object& right) const;
1089    
1090    /**    /**
1091       \brief       \brief
1092         Return the given power of each data point of this boost python object.
1093        
1094         \param left Input - the bases
1095         *
1096       */
1097    
1098      ESCRIPT_DLL_API
1099      Data
1100      rpowO(const boost::python::object& left) const;
1101    
1102      /**
1103         \brief
1104       writes the object to a file in the DX file format       writes the object to a file in the DX file format
1105    */    */
1106      ESCRIPT_DLL_API
1107    void    void
1108    saveDX(std::string fileName) const;    saveDX(std::string fileName) const;
1109    
# Line 924  class Data { Line 1111  class Data {
1111       \brief       \brief
1112       writes the object to a file in the VTK file format       writes the object to a file in the VTK file format
1113    */    */
1114      ESCRIPT_DLL_API
1115    void    void
1116    saveVTK(std::string fileName) const;    saveVTK(std::string fileName) const;
1117    
# Line 933  class Data { Line 1121  class Data {
1121       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1122       *       *
1123    */    */
1124      ESCRIPT_DLL_API
1125    Data& operator+=(const Data& right);    Data& operator+=(const Data& right);
1126      ESCRIPT_DLL_API
1127    Data& operator+=(const boost::python::object& right);    Data& operator+=(const boost::python::object& right);
1128    
1129    /**    /**
# Line 942  class Data { Line 1132  class Data {
1132       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1133       *       *
1134    */    */
1135      ESCRIPT_DLL_API
1136    Data& operator-=(const Data& right);    Data& operator-=(const Data& right);
1137      ESCRIPT_DLL_API
1138    Data& operator-=(const boost::python::object& right);    Data& operator-=(const boost::python::object& right);
1139    
1140   /**   /**
# Line 951  class Data { Line 1143  class Data {
1143       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1144       *       *
1145    */    */
1146      ESCRIPT_DLL_API
1147    Data& operator*=(const Data& right);    Data& operator*=(const Data& right);
1148      ESCRIPT_DLL_API
1149    Data& operator*=(const boost::python::object& right);    Data& operator*=(const boost::python::object& right);
1150    
1151   /**   /**
# Line 960  class Data { Line 1154  class Data {
1154       \param right - Input - The right hand side.       \param right - Input - The right hand side.
1155       *       *
1156    */    */
1157      ESCRIPT_DLL_API
1158    Data& operator/=(const Data& right);    Data& operator/=(const Data& right);
1159      ESCRIPT_DLL_API
1160    Data& operator/=(const boost::python::object& right);    Data& operator/=(const boost::python::object& right);
1161    
1162    /**    /**
1163       \brief       \brief
1164       Returns true if this can be interpolated to functionspace.       Returns true if this can be interpolated to functionspace.
1165    */    */
1166      ESCRIPT_DLL_API
1167    bool    bool
1168    probeInterpolation(const FunctionSpace& functionspace) const;    probeInterpolation(const FunctionSpace& functionspace) const;
1169    
# Line 985  class Data { Line 1182  class Data {
1182       \param key - Input - python slice tuple specifying       \param key - Input - python slice tuple specifying
1183       slice to return.       slice to return.
1184    */    */
1185      ESCRIPT_DLL_API
1186    Data    Data
1187    getItem(const boost::python::object& key) const;    getItem(const boost::python::object& key) const;
1188    
# Line 999  class Data { Line 1197  class Data {
1197       slice to copy from value.       slice to copy from value.
1198       \param value - Input - Data object to copy from.       \param value - Input - Data object to copy from.
1199    */    */
1200      ESCRIPT_DLL_API
1201    void    void
1202    setItemD(const boost::python::object& key,    setItemD(const boost::python::object& key,
1203             const Data& value);             const Data& value);
1204    
1205      ESCRIPT_DLL_API
1206    void    void
1207    setItemO(const boost::python::object& key,    setItemO(const boost::python::object& key,
1208             const boost::python::object& value);             const boost::python::object& value);
# Line 1015  class Data { Line 1215  class Data {
1215       this Data object.       this Data object.
1216    */    */
1217    template <class UnaryFunction>    template <class UnaryFunction>
1218      ESCRIPT_DLL_API
1219    inline    inline
1220    void    void
1221    unaryOp(UnaryFunction operation);    unaryOp(UnaryFunction operation);
# Line 1026  class Data { Line 1227  class Data {
1227       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1228       *       *
1229    */    */
1230      ESCRIPT_DLL_API
1231    Data    Data
1232    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataArrayView::RegionType& region) const;
1233    
# Line 1037  class Data { Line 1239  class Data {
1239       \param region - Input - Region to copy.       \param region - Input - Region to copy.
1240       *       *
1241    */    */
1242      ESCRIPT_DLL_API
1243    void    void
1244    setSlice(const Data& value,    setSlice(const Data& value,
1245             const DataArrayView::RegionType& region);             const DataArrayView::RegionType& region);
# Line 1046  class Data { Line 1249  class Data {
1249       Archive the current Data object to the given file.       Archive the current Data object to the given file.
1250       \param fileName - Input - file to archive to.       \param fileName - Input - file to archive to.
1251    */    */
1252      ESCRIPT_DLL_API
1253    void    void
1254    archiveData(const std::string fileName);    archiveData(const std::string fileName);
1255    
# Line 1057  class Data { Line 1261  class Data {
1261       \param fileName - Input - file to extract from.       \param fileName - Input - file to extract from.
1262       \param fspace - Input - a suitable FunctionSpace descibing the data.       \param fspace - Input - a suitable FunctionSpace descibing the data.
1263    */    */
1264      ESCRIPT_DLL_API
1265    void    void
1266    extractData(const std::string fileName,    extractData(const std::string fileName,
1267                const FunctionSpace& fspace);                const FunctionSpace& fspace);
1268    
1269    
1270      /**
1271         \brief
1272         print the data values to stdout. Used for debugging
1273      */
1274      ESCRIPT_DLL_API
1275      void
1276        print(void);
1277    
1278      /**
1279         \brief
1280         return the MPI rank number of the local data
1281             MPI_COMM_WORLD is assumed and the result of MPI_Comm_size()
1282             is returned
1283      */
1284      ESCRIPT_DLL_API
1285        int
1286        get_MPIRank(void) const;
1287    
1288      /**
1289         \brief
1290         return the MPI rank number of the local data
1291             MPI_COMM_WORLD is assumed and the result of MPI_Comm_rank()
1292             is returned
1293      */
1294      ESCRIPT_DLL_API
1295        int
1296        get_MPISize(void) const;
1297    
1298      /**
1299         \brief
1300         return the MPI rank number of the local data
1301             MPI_COMM_WORLD is assumed and returned.
1302      */
1303      ESCRIPT_DLL_API
1304        MPI_Comm
1305        get_MPIComm(void) const;
1306    
1307      /**
1308         \brief
1309         return the object produced by the factory, which is a DataConstant or DataExpanded
1310      */
1311      ESCRIPT_DLL_API
1312        DataAbstract*
1313        borrowData(void) const;
1314    
1315   protected:   protected:
1316    
1317   private:   private:
# Line 1118  class Data { Line 1369  class Data {
1369    
1370    /**    /**
1371       \brief       \brief
      Perform the given binary operation on all of the data's elements.  
      RHS is a boost::python object.  
   */  
   template <class BinaryFunction>  
   inline  
   void  
   binaryOp(const boost::python::object& right,  
            BinaryFunction operation);  
   
   /**  
      \brief  
1372       Convert the data type of the RHS to match this.       Convert the data type of the RHS to match this.
1373       \param right - Input - data type to match.       \param right - Input - data type to match.
1374    */    */
# Line 1153  class Data { Line 1393  class Data {
1393               const FunctionSpace& what,               const FunctionSpace& what,
1394               bool expanded);               bool expanded);
1395    
1396    /**    //
1397       \brief    // flag to protect the data object against any update
1398       Reshape the data point if the data point is currently rank 0.    bool m_protected;
      Will throw an exception if the data points are not rank 0.  
      The original data point value is used for all values of the new  
      data point.  
   */  
   void  
   reshapeDataPoint(const DataArrayView::ShapeType& shape);  
1399    
1400    //    //
1401    // pointer to the actual data object    // pointer to the actual data object
# Line 1198  Data::initialise(const IValueType& value Line 1432  Data::initialise(const IValueType& value
1432  /**  /**
1433     Binary Data object operators.     Binary Data object operators.
1434  */  */
1435    inline double rpow(double x,double y)
1436    {
1437        return pow(y,x);
1438    };
1439    
1440  /**  /**
1441    \brief    \brief
1442    Operator+    Operator+
1443    Takes two Data objects.    Takes two Data objects.
1444  */  */
1445  Data operator+(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const Data& right);
1446    
1447  /**  /**
1448    \brief    \brief
1449    Operator-    Operator-
1450    Takes two Data objects.    Takes two Data objects.
1451  */  */
1452  Data operator-(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const Data& right);
1453    
1454  /**  /**
1455    \brief    \brief
1456    Operator*    Operator*
1457    Takes two Data objects.    Takes two Data objects.
1458  */  */
1459  Data operator*(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const Data& right);
1460    
1461  /**  /**
1462    \brief    \brief
1463    Operator/    Operator/
1464    Takes two Data objects.    Takes two Data objects.
1465  */  */
1466  Data operator/(const Data& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const Data& right);
1467    
1468  /**  /**
1469    \brief    \brief
# Line 1233  Data operator/(const Data& left, const D Line 1471  Data operator/(const Data& left, const D
1471    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1472    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1473  */  */
1474  Data operator+(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator+(const Data& left, const boost::python::object& right);
1475    
1476  /**  /**
1477    \brief    \brief
# Line 1241  Data operator+(const Data& left, const b Line 1479  Data operator+(const Data& left, const b
1479    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1480    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1481  */  */
1482  Data operator-(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator-(const Data& left, const boost::python::object& right);
1483    
1484  /**  /**
1485    \brief    \brief
# Line 1249  Data operator-(const Data& left, const b Line 1487  Data operator-(const Data& left, const b
1487    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1488    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1489  */  */
1490  Data operator*(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator*(const Data& left, const boost::python::object& right);
1491    
1492  /**  /**
1493    \brief    \brief
# Line 1257  Data operator*(const Data& left, const b Line 1495  Data operator*(const Data& left, const b
1495    Takes LHS Data object and RHS python::object.    Takes LHS Data object and RHS python::object.
1496    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1497  */  */
1498  Data operator/(const Data& left, const boost::python::object& right);  ESCRIPT_DLL_API Data operator/(const Data& left, const boost::python::object& right);
1499    
1500  /**  /**
1501    \brief    \brief
# Line 1265  Data operator/(const Data& left, const b Line 1503  Data operator/(const Data& left, const b
1503    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1504    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1505  */  */
1506  Data operator+(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator+(const boost::python::object& left, const Data& right);
1507    
1508  /**  /**
1509    \brief    \brief
# Line 1273  Data operator+(const boost::python::obje Line 1511  Data operator+(const boost::python::obje
1511    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1512    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1513  */  */
1514  Data operator-(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator-(const boost::python::object& left, const Data& right);
1515    
1516  /**  /**
1517    \brief    \brief
# Line 1281  Data operator-(const boost::python::obje Line 1519  Data operator-(const boost::python::obje
1519    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1520    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1521  */  */
1522  Data operator*(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator*(const boost::python::object& left, const Data& right);
1523    
1524  /**  /**
1525    \brief    \brief
# Line 1289  Data operator*(const boost::python::obje Line 1527  Data operator*(const boost::python::obje
1527    Takes LHS python::object and RHS Data object.    Takes LHS python::object and RHS Data object.
1528    python::object must be convertable to Data type.    python::object must be convertable to Data type.
1529  */  */
1530  Data operator/(const boost::python::object& left, const Data& right);  ESCRIPT_DLL_API Data operator/(const boost::python::object& left, const Data& right);
1531    
1532  /**  /**
1533    \brief    \brief
1534    Output operator    Output operator
1535  */  */
1536  std::ostream& operator<<(std::ostream& o, const Data& data);  ESCRIPT_DLL_API std::ostream& operator<<(std::ostream& o, const Data& data);
1537    
1538    /**
1539      \brief
1540      Compute a tensor product of two Data objects
1541      \param arg0 - Input - Data object
1542      \param arg1 - Input - Data object
1543      \param axis_offset - Input - axis offset
1544      \param transpose - Input - 0: transpose neither, 1: transpose arg0, 2: transpose arg1
1545    */
1546    ESCRIPT_DLL_API
1547    Data
1548    C_GeneralTensorProduct(Data& arg0,
1549                         Data& arg1,
1550                         int axis_offset=0,
1551                         int transpose=0);
1552    
1553  /**  /**
1554    \brief    \brief
# Line 1303  std::ostream& operator<<(std::ostream& o Line 1556  std::ostream& operator<<(std::ostream& o
1556    NB: this operator does very little at this point, and isn't to    NB: this operator does very little at this point, and isn't to
1557    be relied on. Requires further implementation.    be relied on. Requires further implementation.
1558  */  */
1559  //bool operator==(const Data& left, const Data& right);  //ESCRIPT_DLL_API bool operator==(const Data& left, const Data& right);
1560    
1561  /**  /**
1562    \brief    \brief
# Line 1319  Data::binaryOp(const Data& right, Line 1572  Data::binaryOp(const Data& right,
1572     //     //
1573     // if this has a rank of zero promote it to the rank of the RHS     // if this has a rank of zero promote it to the rank of the RHS
1574     if (getPointDataView().getRank()==0 && right.getPointDataView().getRank()!=0) {     if (getPointDataView().getRank()==0 && right.getPointDataView().getRank()!=0) {
1575       reshapeDataPoint(right.getPointDataView().getShape());       throw DataException("Error - attempt to update rank zero object with object with rank bigger than zero.");
1576     }     }
1577     //     //
1578     // initially make the temporary a shallow copy     // initially make the temporary a shallow copy
# Line 1371  Data::binaryOp(const Data& right, Line 1624  Data::binaryOp(const Data& right,
1624       EsysAssert((leftC!=0 && rightC!=0), "Programming error - casting to DataConstant.");       EsysAssert((leftC!=0 && rightC!=0), "Programming error - casting to DataConstant.");
1625       escript::binaryOp(*leftC,*rightC,operation);       escript::binaryOp(*leftC,*rightC,operation);
1626     }     }
1627  }     #if defined DOPROF
1628       profData->binary++;
1629  /**     #endif
   \brief  
   Perform the given binary operation with this and right as operands.  
   Right is a boost::python object.  
 */  
 template <class BinaryFunction>  
 inline  
 void  
 Data::binaryOp(const boost::python::object& right,  
                BinaryFunction operation)  
 {  
    DataArray temp(right);  
    //  
    // if this has a rank of zero promote it to the rank of the RHS.  
    if (getPointDataView().getRank()==0 && temp.getView().getRank()!=0) {  
       reshapeDataPoint(temp.getView().getShape());  
    }  
    //  
    // Always allow scalar values for the RHS but check other shapes  
    if (temp.getView().getRank()!=0) {  
      if (!getPointDataView().checkShape(temp.getView().getShape())) {  
        throw DataException(getPointDataView().createShapeErrorMessage(  
                   "Error - RHS shape doesn't match LHS shape.",temp.getView().getShape()));  
      }  
    }  
    if (isExpanded()) {  
      DataExpanded* leftC=dynamic_cast<DataExpanded*>(m_data.get());  
      EsysAssert((leftC!=0),"Programming error - casting to DataExpanded.");  
      escript::binaryOp(*leftC,temp.getView(),operation);  
    } else if (isTagged()) {  
      DataTagged* leftC=dynamic_cast<DataTagged*>(m_data.get());  
      EsysAssert((leftC!=0), "Programming error - casting to DataTagged.");  
      escript::binaryOp(*leftC,temp.getView(),operation);  
    } else if (isConstant()) {  
      DataConstant* leftC=dynamic_cast<DataConstant*>(m_data.get());  
      EsysAssert((leftC!=0),"Programming error - casting to DataConstant.");  
      escript::binaryOp(*leftC,temp.getView(),operation);  
    }  
1630  }  }
1631    
1632  /**  /**

Legend:
Removed from v.698  
changed lines
  Added in v.921

  ViewVC Help
Powered by ViewVC 1.1.26