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

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

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

trunk/escript/src/AbstractSystemMatrix.h revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC trunk/escript/src/AbstractTransportProblem.h revision 1407 by gross, Mon Feb 4 06:45:48 2008 UTC
# Line 1  Line 1 
 // $Id$  
 /*  
  ************************************************************  
  *          Copyright 2006 by ACcESS MNRF                   *  
  *                                                          *  
  *              http://www.access.edu.au                    *  
  *       Primary Business: Queensland, Australia            *  
  *  Licensed under the Open Software License version 3.0    *  
  *     http://www.opensource.org/licenses/osl-3.0.php       *  
  *                                                          *  
  ************************************************************  
1    
2  */  /* $Id$ */
3    
4    /*******************************************************
5     *
6     *       Copyright 2007 by University of Queensland
7     *
8     *                http://esscc.uq.edu.au
9     *        Primary Business: Queensland, Australia
10     *  Licensed under the Open Software License version 3.0
11     *     http://www.opensource.org/licenses/osl-3.0.php
12     *
13     *******************************************************/
14    
15  #if !defined  escript_AbstractSystemMatrix_20040628_H  #if !defined  escript_AbstractTransportProblem_H
16  #define escript_AbstractSystemMatrix_20040628_H  #define escript_AbstractTransportProblem_H
17  #include "system_dep.h"  #include "system_dep.h"
18    
19  #include "FunctionSpace.h"  #include "FunctionSpace.h"
20  #include "SystemMatrixException.h"  #include "TransportProblemException.h"
21    
22  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
23    
# Line 29  namespace escript { Line 29  namespace escript {
29    
30  /**  /**
31     \brief     \brief
32     Give a short description of what AbstractSystemMatrix does.     Give a short description of what AbstractTransportProblem does.
33    
34     Description:     Description:
35     Give a detailed description of AbstractSystemMatrix     Give a detailed description of AbstractTransportProblem
36    
37     Template Parameters:     Template Parameters:
38     For templates describe any conditions that the parameters used in the     For templates describe any conditions that the parameters used in the
39     template must satisfy     template must satisfy
40  */  */
41  class AbstractSystemMatrix {  class AbstractTransportProblem {
42    
43   public:   public:
44    
45    /**    /**
46       \brief       \brief
47       Default constructor for AbstractSystemMatrix       Default constructor for AbstractTransportProblem
48    
49       Description:       Description:
50       Default constructor for AbstractSystemMatrix       Default constructor for AbstractTransportProblem
51    
52       Preconditions:       Preconditions:
53       Describe any preconditions       Describe any preconditions
# Line 56  class AbstractSystemMatrix { Line 56  class AbstractSystemMatrix {
56       Describe any exceptions thrown       Describe any exceptions thrown
57    */    */
58    ESCRIPT_DLL_API    ESCRIPT_DLL_API
59    AbstractSystemMatrix();    AbstractTransportProblem();
60    
61    ESCRIPT_DLL_API    ESCRIPT_DLL_API
62    AbstractSystemMatrix(const int row_blocksize,    AbstractTransportProblem(const double theta,
63                         const FunctionSpace& row_functionspace,                             const int blocksize,
64                         const int column_blocksize,                             const FunctionSpace& functionspace);
                        const FunctionSpace& column_functionspace);  
   /**  
     \brief  
     Destructor.  
   */  
   ESCRIPT_DLL_API  
   virtual ~AbstractSystemMatrix();  
65    
66    /**    /**
67      \brief      \brief
68      matrix*vector multiplication      Destructor.
69    */    */
70    ESCRIPT_DLL_API    ESCRIPT_DLL_API
71    Data vectorMultiply(Data& right) const;    virtual ~AbstractTransportProblem();
72    
   /**  
     \brief  
     returns true if the matrix is empty  
   */  
73    ESCRIPT_DLL_API    ESCRIPT_DLL_API
74    int isEmpty() const;    int isEmpty() const;
75    
# Line 89  class AbstractSystemMatrix { Line 78  class AbstractSystemMatrix {
78      returns the column function space      returns the column function space
79    */    */
80    ESCRIPT_DLL_API    ESCRIPT_DLL_API
81    inline FunctionSpace getColumnFunctionSpace() const    inline FunctionSpace getFunctionSpace() const
82    {    {
83         if (isEmpty())         if (isEmpty())
84              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Transport Problem is empty.");
85         return m_column_functionspace;         return m_functionspace;
86    }    }
87    
88    /**    /**
89      \brief      \brief
90      returns the row function space      returns the block size
91    */    */
92    ESCRIPT_DLL_API    ESCRIPT_DLL_API
93    inline FunctionSpace getRowFunctionSpace() const    inline int getBlockSize() const
94    {    {
95         if (isEmpty())         if (isEmpty())
96              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Transport Problem is empty.");
97         return m_row_functionspace;         return m_blocksize;
98    }    }
99    
100    /**    /**
101      \brief       \brief
102      returns the row block size       returns the solution u for a time step dt>0
   */  
   ESCRIPT_DLL_API  
   inline int getRowBlockSize() const  
   {  
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_row_blocksize;  
   }  
   
   /**  
     \brief  
     returns the column block size  
103    */    */
104    ESCRIPT_DLL_API    ESCRIPT_DLL_API
105    inline int getColumnBlockSize() const    Data solve(Data& source, const double dt, const boost::python::dict& options) const;
   {  
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_column_blocksize;  
   }  
106    
107    /**    /**
108       \brief       \brief
109       returns the solution u of the linear system this*u=in       sets the value for u at time t=0.
110    */    */
111    ESCRIPT_DLL_API    ESCRIPT_DLL_API
112    Data solve(Data& in,const boost::python::dict& options) const;    void setInitialValue(Data& u) const;
   
113    /**    /**
114       \brief writes the matrix to a file using the Matrix Market file format       \brief resets the transport operator typically as they have been updated.
115    */    */
116    ESCRIPT_DLL_API    ESCRIPT_DLL_API
117    virtual void saveMM(const std::string& fileName) const;    virtual void resetTransport() const;
118    
119    /**    /**
120       \brief writes the matrix to a file using the Harwell-Boeing file format     *      \brief returns a save time step size.
121    */     *        */
122    ESCRIPT_DLL_API    ESCRIPT_DLL_API
123    virtual void saveHB(const std::string& fileName) const;    virtual double getSafeTimeStepSize() const;
124    
   /**  
      \brief resets the matrix entries  
   */  
   ESCRIPT_DLL_API  
   virtual void resetValues() const;  
125    
126   protected:   protected:
127    
# Line 163  class AbstractSystemMatrix { Line 129  class AbstractSystemMatrix {
129    
130    /**    /**
131       \brief       \brief
132       solves the linear system this*out=in       sets solution out by time step dt.
133    */    */
134    ESCRIPT_DLL_API    ESCRIPT_DLL_API
135    virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;    virtual void setToSolution(Data& out,Data& source,const double dt, const boost::python::dict& options) const;
136    
137    /**    /**
138       \brief       \brief
139       performs y+=this*x       copies the initial value into the problem
140    */    */
141    ESCRIPT_DLL_API    ESCRIPT_DLL_API
142    virtual void ypAx(Data& y,Data& x) const;    virtual void copyInitialValue(Data& u) const;
143    
144    int m_empty;    int m_empty;
145    int m_column_blocksize;    int m_blocksize;
146    int m_row_blocksize;    double m_theta;
147    FunctionSpace m_column_functionspace;    FunctionSpace m_functionspace;
   FunctionSpace m_row_functionspace;  
148    
149  };  };
150    
 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;  
   
   
151    
152  } // end of namespace  } // end of namespace
153  #endif  #endif

Legend:
Removed from v.757  
changed lines
  Added in v.1407

  ViewVC Help
Powered by ViewVC 1.1.26