/[escript]/branches/trilinos_from_5897/escriptcore/src/DataConstant.h
ViewVC logotype

Diff of /branches/trilinos_from_5897/escriptcore/src/DataConstant.h

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

trunk/escript/src/DataConstant.h revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC branches/trilinos_from_5897/escriptcore/src/DataConstant.h revision 5963 by caltinay, Mon Feb 22 06:59:27 2016 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2016 by The University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
10  *  *
11  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    * Development 2012-2013 by School of Earth Sciences
13    * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14    *
15    *****************************************************************************/
16    
17    
18  #if !defined escript_DataConstant_20040323_H  #if !defined escript_DataConstant_20040323_H
# Line 19  Line 22 
22  #include "DataReady.h"  #include "DataReady.h"
23  #include "WrappedArray.h"  #include "WrappedArray.h"
24    
 #include <boost/python/numeric.hpp>  
25    
26  namespace escript {  namespace escript {
27    
# Line 85  typedef DataReady parent; Line 87  typedef DataReady parent;
87    ESCRIPT_DLL_API    ESCRIPT_DLL_API
88    DataConstant(const FunctionSpace& what,    DataConstant(const FunctionSpace& what,
89                 const DataTypes::ShapeType &shape,                 const DataTypes::ShapeType &shape,
90                 const DataTypes::ValueType &data);                 const DataTypes::RealVectorType &data);
   
91    
92    ESCRIPT_DLL_API    ESCRIPT_DLL_API
93      DataConstant(const FunctionSpace& what,
94                               const DataTypes::ShapeType &shape,
95                               const double v);
96                  
97                  
98      ESCRIPT_DLL_API
99    bool    bool
100    isConstant() const    isConstant() const
101    {    {
102      return true;      return true;
103    };    };
104    
105      /**
106      \brief Return true if the value contains a NaN.
107      */
108      ESCRIPT_DLL_API
109      bool
110      hasNaN() const;
111    
112      /**
113      \brief replaces all NaN values with value
114      */
115      ESCRIPT_DLL_API
116      void
117      replaceNaN(DataTypes::real_t value);
118    
119      ESCRIPT_DLL_API
120      void
121      replaceNaN(DataTypes::cplx_t value);
122    
123    /**    /**
124       \brief       \brief
# Line 110  typedef DataReady parent; Line 134  typedef DataReady parent;
134    ESCRIPT_DLL_API    ESCRIPT_DLL_API
135    virtual    virtual
136    DataAbstract*    DataAbstract*
137    deepCopy();    deepCopy() const;
138    
139    
140   /**   /**
# Line 142  typedef DataReady parent; Line 166  typedef DataReady parent;
166     */     */
167    ESCRIPT_DLL_API    ESCRIPT_DLL_API
168    virtual    virtual
169    DataTypes::ValueType::size_type    DataTypes::RealVectorType::size_type
170    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
171                   int dataPointNo) const;                   int dataPointNo) const;
172    
173    ESCRIPT_DLL_API    ESCRIPT_DLL_API
174    virtual    virtual
175    DataTypes::ValueType::size_type    DataTypes::RealVectorType::size_type
176    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
177                   int dataPointNo);                   int dataPointNo);
178    
# Line 158  typedef DataReady parent; Line 182  typedef DataReady parent;
182    */    */
183    ESCRIPT_DLL_API    ESCRIPT_DLL_API
184    virtual    virtual
185    DataTypes::ValueType::size_type    DataTypes::RealVectorType::size_type
186    getLength() const;    getLength() const;
187    
188    /**    /**
# Line 272  typedef DataReady parent; Line 296  typedef DataReady parent;
296    
297    
298    /**    /**
299        \brief invert square matricies
300        \param out - Where to store the results
301        \return errorcode (0 indicates success)
302      */
303      ESCRIPT_DLL_API
304      virtual int
305      matrixInverse(DataAbstract* out) const;
306    
307      /**
308       \brief       \brief
309       Return a reference to the underlying DataVector.       Return a reference to the underlying DataVector.
310    */    */
311    ESCRIPT_DLL_API    ESCRIPT_DLL_API
312    DataTypes::ValueType&    DataTypes::RealVectorType&
313    getVectorRW();    getVectorRW();
314    
315    
316    ESCRIPT_DLL_API    ESCRIPT_DLL_API
317    const DataTypes::ValueType&    const DataTypes::RealVectorType&
318    getVectorRO() const;    getVectorRO() const;
319    
320      ESCRIPT_DLL_API
321      DataTypes::CplxVectorType&
322      getVectorRWC();
323    
324    
325      ESCRIPT_DLL_API
326      const DataTypes::CplxVectorType&
327      getVectorROC() const;  
328    
329    
330    
331      ESCRIPT_DLL_API
332      virtual DataTypes::RealVectorType&
333      getTypedVectorRW(DataTypes::real_t dummy);  
334      
335      ESCRIPT_DLL_API
336      virtual const DataTypes::RealVectorType&
337      getTypedVectorRO(DataTypes::real_t dummy) const;
338    
339      ESCRIPT_DLL_API
340      virtual DataTypes::CplxVectorType&
341      getTypedVectorRW(DataTypes::cplx_t dummy);
342      
343      ESCRIPT_DLL_API
344      virtual const DataTypes::CplxVectorType&
345      getTypedVectorRO(DataTypes::cplx_t dummy) const;  
346    
347    
348    
349      
350      /**
351       * \brief Convert from real data to complex data.
352      */
353      ESCRIPT_DLL_API
354      void complicate();
355    
356   protected:   protected:
357    
358   private:   private:
359    //    //
360    // the actual data    // the actual data
361    DataTypes::ValueType m_data;    DataTypes::RealVectorType m_data_r;
362      DataTypes::CplxVectorType m_data_c;
363    
364  };  };
365    

Legend:
Removed from v.2548  
changed lines
  Added in v.5963

  ViewVC Help
Powered by ViewVC 1.1.26