/[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 2474 by gross, Tue Jun 16 06:32:15 2009 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  */  /*******************************************************
3    *
4    * Copyright (c) 2003-2008 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
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    #include <boost/python/object.hpp>
 #include <boost/python/dict.hpp>  
22    
23  //  //
24  // Forward declaration  // Forward declaration
# Line 29  namespace escript { Line 28  namespace escript {
28    
29  /**  /**
30     \brief     \brief
31     Give a short description of what AbstractSystemMatrix does.     Give a short description of what AbstractTransportProblem does.
32    
33     Description:     Description:
34     Give a detailed description of AbstractSystemMatrix     Give a detailed description of AbstractTransportProblem
35    
36     Template Parameters:     Template Parameters:
37     For templates describe any conditions that the parameters used in the     For templates describe any conditions that the parameters used in the
38     template must satisfy     template must satisfy
39  */  */
40  class AbstractSystemMatrix {  class AbstractTransportProblem {
41    
42   public:   public:
43    
44    /**    /**
45       \brief       \brief
46       Default constructor for AbstractSystemMatrix       Default constructor for AbstractTransportProblem
47    
48       Description:       Description:
49       Default constructor for AbstractSystemMatrix       Default constructor for AbstractTransportProblem
50    
51       Preconditions:       Preconditions:
52       Describe any preconditions       Describe any preconditions
# Line 56  class AbstractSystemMatrix { Line 55  class AbstractSystemMatrix {
55       Describe any exceptions thrown       Describe any exceptions thrown
56    */    */
57    ESCRIPT_DLL_API    ESCRIPT_DLL_API
58    AbstractSystemMatrix();    AbstractTransportProblem();
59    
60    ESCRIPT_DLL_API    ESCRIPT_DLL_API
61    AbstractSystemMatrix(const int row_blocksize,    AbstractTransportProblem(const double theta,
62                         const FunctionSpace& row_functionspace,                             const int blocksize,
63                         const int column_blocksize,                             const FunctionSpace& functionspace);
64                         const FunctionSpace& column_functionspace);  
65    /**    /**
66      \brief      \brief
67      Destructor.      Destructor.
68    */    */
69    ESCRIPT_DLL_API    ESCRIPT_DLL_API
70    virtual ~AbstractSystemMatrix();    virtual ~AbstractTransportProblem();
71    
   /**  
     \brief  
     matrix*vector multiplication  
   */  
   ESCRIPT_DLL_API  
   Data vectorMultiply(Data& right) const;  
   
   /**  
     \brief  
     returns true if the matrix is empty  
   */  
72    ESCRIPT_DLL_API    ESCRIPT_DLL_API
73    int isEmpty() const;    int isEmpty() const;
74    
# Line 89  class AbstractSystemMatrix { Line 77  class AbstractSystemMatrix {
77      returns the column function space      returns the column function space
78    */    */
79    ESCRIPT_DLL_API    ESCRIPT_DLL_API
80    inline FunctionSpace getColumnFunctionSpace() const    inline FunctionSpace getFunctionSpace() const
81    {    {
82         if (isEmpty())         if (isEmpty())
83              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Transport Problem is empty.");
84         return m_column_functionspace;         return m_functionspace;
85    }    }
86    
87    /**    /**
88      \brief      \brief
89      returns the row function space      returns the block size
90    */    */
91    ESCRIPT_DLL_API    ESCRIPT_DLL_API
92    inline FunctionSpace getRowFunctionSpace() const    inline int getBlockSize() const
93    {    {
94         if (isEmpty())         if (isEmpty())
95              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Transport Problem is empty.");
96         return m_row_functionspace;         return m_blocksize;
97    }    }
98    
99    /**    /**
100      \brief       \brief
101      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  
102    */    */
103    ESCRIPT_DLL_API    ESCRIPT_DLL_API
104    inline int getColumnBlockSize() const    Data solve(Data& source, const double dt, boost::python::object& options) const;
   {  
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_column_blocksize;  
   }  
105    
106    /**    /**
107       \brief       \brief
108       returns the solution u of the linear system this*u=in       sets the value for u at time t=0.
109    */    */
110    ESCRIPT_DLL_API    ESCRIPT_DLL_API
111    Data solve(Data& in,const boost::python::dict& options) const;    void setInitialValue(Data& u) const;
112    
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
121         inserts constraint u_{,t}=r where q>0  into the problem using a weighting factor
122    */    */
123    ESCRIPT_DLL_API    ESCRIPT_DLL_API
124    virtual void saveHB(const std::string& fileName) const;    void insertConstraint(Data& source, Data& q, Data& r, const double factor) const;
125      /*
126    /**     *      \brief returns a safe time step size.
127       \brief resets the matrix entries     */
128    */    ESCRIPT_DLL_API
129      virtual double getSafeTimeStepSize() const;
130      /*
131       *      \brief returns the value for unlimited time step size.
132       */
133    ESCRIPT_DLL_API    ESCRIPT_DLL_API
134    virtual void resetValues() const;    virtual double getUnlimitedTimeStepSize() const;
135    
136    
137   protected:   protected:
138    
# Line 163  class AbstractSystemMatrix { Line 140  class AbstractSystemMatrix {
140    
141    /**    /**
142       \brief       \brief
143       solves the linear system this*out=in       sets solution out by time step dt.
144    */    */
145    ESCRIPT_DLL_API    ESCRIPT_DLL_API
146    virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;    virtual void setToSolution(Data& out,Data& source,const double dt, boost::python::object& options) const;
147    
148    /**    /**
149       \brief       \brief
150       performs y+=this*x       copies the initial value into the problem
151    */    */
152    ESCRIPT_DLL_API    ESCRIPT_DLL_API
153    virtual void ypAx(Data& y,Data& x) const;    virtual void copyInitialValue(Data& u) const;
154      /**
155         \brief
156         copy constraint u_{,t}=r where q>0  into the problem
157         it can be assumed that q and r are not empty and have  
158         appropriate shape and function space.
159      */
160      ESCRIPT_DLL_API
161      virtual void copyConstraint(Data& source, Data& q, Data& r, const double factor) const;
162    
163    int m_empty;    int m_empty;
164    int m_column_blocksize;    int m_blocksize;
165    int m_row_blocksize;    double m_theta;
166    FunctionSpace m_column_functionspace;    FunctionSpace m_functionspace;
   FunctionSpace m_row_functionspace;  
167    
168  };  };
169    
 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;  
   
   
170    
171  } // end of namespace  } // end of namespace
172  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26