/[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/esys2/escript/src/Data/AbstractSystemMatrix.h revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/escript/src/AbstractTransportProblem.h revision 1364 by gross, Mon Dec 17 07:22:45 2007 UTC
# Line 1  Line 1 
1  /*  
2   ******************************************************************************  /* $Id:$ */
3   *                                                                            *  
4   *       COPYRIGHT  ACcESS 2004 -  All Rights Reserved                        *  /*******************************************************
5   *                                                                            *   *
6   * This software is the property of ACcESS. No part of this code              *   *       Copyright 2007 by University of Queensland
7   * may be copied in any form or by any means without the expressed written    *   *
8   * consent of ACcESS.  Copying, use or modification of this software          *   *                http://esscc.uq.edu.au
9   * by any unauthorised person is illegal unless that person has a software    *   *        Primary Business: Queensland, Australia
10   * license agreement with ACcESS.                                             *   *  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"
18  #include "escript/Data/FunctionSpace.h"  
19  #include "escript/Data/SystemMatrixException.h"  #include "FunctionSpace.h"
20  #include "escript/Data/Data.h"  #include "TransportProblemException.h"
21    
22  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
23    
24    //
25    // Forward declaration
26    class Data;
27    
28  namespace escript {  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 50  class AbstractSystemMatrix { Line 55  class AbstractSystemMatrix {
55       Throws:       Throws:
56       Describe any exceptions thrown       Describe any exceptions thrown
57    */    */
58    AbstractSystemMatrix();    ESCRIPT_DLL_API
59      AbstractTransportProblem();
60    
61    AbstractSystemMatrix(const int row_blocksize,    ESCRIPT_DLL_API
62                         const FunctionSpace& row_functionspace,    AbstractTransportProblem(const double theta,
63                         const int column_blocksize,                             const double dt_max,
64                         const FunctionSpace& column_functionspace);                             const int blocksize,
65    /**                             const FunctionSpace& functionspace);
     \brief  
     Destructor.  
   */  
   virtual ~AbstractSystemMatrix();  
66    
67    /**    /**
68      \brief      \brief
69      matrix*vector multiplication      Destructor.
70    */    */
71    Data vectorMultiply(const Data& right) const;    ESCRIPT_DLL_API
72      virtual ~AbstractTransportProblem();
73    
74    /**    ESCRIPT_DLL_API
     \brief  
     returns true if the matrix is empty  
   */  
75    int isEmpty() const;    int isEmpty() const;
76    
77    /**    /**
78      \brief      \brief
79      returns the column function space      returns the column function space
80    */    */
81    inline FunctionSpace getColumnFunctionSpace() const    ESCRIPT_DLL_API
82      inline FunctionSpace getFunctionSpace() const
83    {    {
84         if (isEmpty())         if (isEmpty())
85              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Matrix is empty.");
86         return m_column_functionspace;         return m_functionspace;
87    }    }
88    
89    /**    /**
90      \brief      \brief
91      returns the row function space      returns the block size
92    */    */
93    inline FunctionSpace getRowFunctionSpace() const    ESCRIPT_DLL_API
94      inline int getBlockSize() const
95    {    {
96         if (isEmpty())         if (isEmpty())
97              throw SystemMatrixException("Error - Matrix is empty.");              throw TransportProblemException("Error - Matrix is empty.");
98         return m_row_functionspace;         return m_blocksize;
99    }    }
100    
101    /**    /**
102      \brief       \brief
103      returns the row block size       returns the solution u for a time step dt>0
104    */    */
105    inline int getRowBlockSize() const    ESCRIPT_DLL_API
106    {    Data solve(Data& source, const double dt, const boost::python::dict& options) const;
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_row_blocksize;  
   }  
107    
108    /**    /**
109      \brief       \brief
110      returns the column block size       sets the value for u at time t=0.
111    */    */
112    inline int getColumnBlockSize() const    ESCRIPT_DLL_API
113    {    void setInitialValue(Data& u) const;
        if (isEmpty())  
             throw SystemMatrixException("Error - Matrix is empty.");  
        return m_column_blocksize;  
   }  
   
114    /**    /**
115       \brief       \brief resets the transport operator typically as they have been updated.
      returns the solution u of the linear system this*u=in  
116    */    */
117    Data solve(const Data& in,const boost::python::dict& options) const;    ESCRIPT_DLL_API
118      virtual void resetTransport() const;
119    
120   protected:   protected:
121    
# Line 130  class AbstractSystemMatrix { Line 123  class AbstractSystemMatrix {
123    
124    /**    /**
125       \brief       \brief
126       solves the linear system this*out=in       sets solution out by time step dt.
127    */    */
128    virtual void setToSolution(Data& out,const Data& in,const boost::python::dict& options) const;    ESCRIPT_DLL_API
129      virtual void setToSolution(Data& out,Data& source,const double dt, const boost::python::dict& options) const;
130    
131    /**    /**
132       \brief       \brief
133       performs y+=this*x       copies the initial value into the problem
134    */    */
135    virtual void ypAx(Data& y,const Data& x) const;    ESCRIPT_DLL_API
136      virtual void copyInitialValue(Data& u) const;
137    
138    int m_empty;    int m_empty;
139    int m_column_blocksize;    int m_blocksize;
140    int m_row_blocksize;    double m_theta;
141    FunctionSpace m_column_functionspace;    double m_dt_max;
142    FunctionSpace m_row_functionspace;    FunctionSpace m_functionspace;
143    
144  };  };
145    
 Data operator*(const AbstractSystemMatrix& left, const Data& right) ;  
   
   
146    
147  } // end of namespace  } // end of namespace
148  #endif  #endif

Legend:
Removed from v.82  
changed lines
  Added in v.1364

  ViewVC Help
Powered by ViewVC 1.1.26