/[escript]/branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h
ViewVC logotype

Diff of /branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h

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

trunk/escript/src/AbstractSystemMatrix.h revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC branches/arrexp_2137_win_merge/escript/src/AbstractTransportProblem.h revision 2219 by jfenwick, Wed Jan 14 04:31:34 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * 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    
22  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
23    
# Line 30  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 57  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 90  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
   {  
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_column_functionspace;  
   }  
   
   /**  
     \brief  
     returns the row function space  
   */  
   ESCRIPT_DLL_API  
   inline FunctionSpace getRowFunctionSpace() const  
82    {    {
83         if (isEmpty())         if (isEmpty())
84              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Transport Problem is empty.");
85         return m_row_functionspace;         return m_functionspace;
86    }    }
87    
88    /**    /**
89      \brief      \brief
90      returns the row block size      returns the block size
91    */    */
92    ESCRIPT_DLL_API    ESCRIPT_DLL_API
93    inline int getRowBlockSize() 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_blocksize;         return m_blocksize;
98    }    }
99    
100    /**    /**
101      \brief       \brief
102      returns the column block size       returns the solution u for a time step dt>0
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    /**    /**
115       \brief writes the matrix to a file using the Matrix Market file format       \brief resets the transport operator typically as they have been updated.
116    */    */
117    ESCRIPT_DLL_API    ESCRIPT_DLL_API
118    virtual void saveMM(const std::string& fileName) const;    virtual void resetTransport() const;
119    
120    /**    /**
121       \brief writes the matrix to a file using the Harwell-Boeing file format       \brief
122         inserts constraint u_{,t}=r where q>0  into the problem using a weighting factor
123    */    */
124    ESCRIPT_DLL_API    ESCRIPT_DLL_API
125    virtual void saveHB(const std::string& fileName) const;    void insertConstraint(Data& source, Data& q, Data& r, const double factor) const;
126      /*
127    /**     *      \brief returns a safe time step size.
128       \brief resets the matrix entries     */
129    */    ESCRIPT_DLL_API
130      virtual double getSafeTimeStepSize() const;
131      /*
132       *      \brief returns the value for unlimited time step size.
133       */
134    ESCRIPT_DLL_API    ESCRIPT_DLL_API
135    virtual void resetValues() const;    virtual double getUnlimitedTimeStepSize() const;
136    
137    
138   protected:   protected:
139    
# Line 164  class AbstractSystemMatrix { Line 141  class AbstractSystemMatrix {
141    
142    /**    /**
143       \brief       \brief
144       solves the linear system this*out=in       sets solution out by time step dt.
145    */    */
146    ESCRIPT_DLL_API    ESCRIPT_DLL_API
147    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;
148    
149    /**    /**
150       \brief       \brief
151       performs y+=this*x       copies the initial value into the problem
152    */    */
153    ESCRIPT_DLL_API    ESCRIPT_DLL_API
154    virtual void ypAx(Data& y,Data& x) const;    virtual void copyInitialValue(Data& u) const;
155      /**
156         \brief
157         copy constraint u_{,t}=r where q>0  into the problem
158         it can be assumed that q and r are not empty and have  
159         appropriate shape and function space.
160      */
161      ESCRIPT_DLL_API
162      virtual void copyConstraint(Data& source, Data& q, Data& r, const double factor) const;
163    
164    int m_empty;    int m_empty;
165    int m_column_blocksize;    int m_blocksize;
166    int m_row_blocksize;    double m_theta;
167    FunctionSpace m_column_functionspace;    FunctionSpace m_functionspace;
   FunctionSpace m_row_functionspace;  
168    
169  };  };
170    
 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;  
   
   
171    
172  } // end of namespace  } // end of namespace
173  #endif  #endif

Legend:
Removed from v.1312  
changed lines
  Added in v.2219

  ViewVC Help
Powered by ViewVC 1.1.26