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

Annotation of /trunk/escript/src/AbstractSystemMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 3 months ago) by trankine
Original Path: temp/escript/src/AbstractSystemMatrix.h
File MIME type: text/plain
File size: 4077 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1 elspeth 615
2 ksteube 1312 /* $Id$ */
3 jgs 480
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16 jgs 82 #if !defined escript_AbstractSystemMatrix_20040628_H
17     #define escript_AbstractSystemMatrix_20040628_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20 jgs 474 #include "FunctionSpace.h"
21     #include "SystemMatrixException.h"
22    
23 jgs 82 #include <boost/python/dict.hpp>
24    
25 jgs 480 //
26     // Forward declaration
27     class Data;
28    
29 jgs 82 namespace escript {
30    
31     /**
32     \brief
33     Give a short description of what AbstractSystemMatrix does.
34    
35     Description:
36     Give a detailed description of AbstractSystemMatrix
37    
38     Template Parameters:
39     For templates describe any conditions that the parameters used in the
40     template must satisfy
41     */
42     class AbstractSystemMatrix {
43    
44     public:
45    
46     /**
47     \brief
48     Default constructor for AbstractSystemMatrix
49    
50     Description:
51     Default constructor for AbstractSystemMatrix
52    
53     Preconditions:
54     Describe any preconditions
55    
56     Throws:
57     Describe any exceptions thrown
58     */
59 woo409 757 ESCRIPT_DLL_API
60 jgs 82 AbstractSystemMatrix();
61    
62 woo409 757 ESCRIPT_DLL_API
63 jgs 82 AbstractSystemMatrix(const int row_blocksize,
64     const FunctionSpace& row_functionspace,
65     const int column_blocksize,
66     const FunctionSpace& column_functionspace);
67     /**
68     \brief
69     Destructor.
70     */
71 woo409 757 ESCRIPT_DLL_API
72 jgs 82 virtual ~AbstractSystemMatrix();
73    
74     /**
75     \brief
76     matrix*vector multiplication
77     */
78 woo409 757 ESCRIPT_DLL_API
79 jgs 153 Data vectorMultiply(Data& right) const;
80 jgs 82
81     /**
82     \brief
83     returns true if the matrix is empty
84     */
85 woo409 757 ESCRIPT_DLL_API
86 jgs 82 int isEmpty() const;
87    
88     /**
89     \brief
90     returns the column function space
91     */
92 woo409 757 ESCRIPT_DLL_API
93 jgs 82 inline FunctionSpace getColumnFunctionSpace() const
94     {
95     if (isEmpty())
96     throw SystemMatrixException("Error - Matrix is empty.");
97     return m_column_functionspace;
98     }
99    
100     /**
101     \brief
102     returns the row function space
103     */
104 woo409 757 ESCRIPT_DLL_API
105 jgs 82 inline FunctionSpace getRowFunctionSpace() const
106     {
107     if (isEmpty())
108     throw SystemMatrixException("Error - Matrix is empty.");
109     return m_row_functionspace;
110     }
111    
112     /**
113     \brief
114     returns the row block size
115     */
116 woo409 757 ESCRIPT_DLL_API
117 jgs 82 inline int getRowBlockSize() const
118     {
119     if (isEmpty())
120     throw SystemMatrixException("Error - Matrix is empty.");
121     return m_row_blocksize;
122     }
123    
124     /**
125     \brief
126     returns the column block size
127     */
128 woo409 757 ESCRIPT_DLL_API
129 jgs 82 inline int getColumnBlockSize() const
130     {
131     if (isEmpty())
132     throw SystemMatrixException("Error - Matrix is empty.");
133     return m_column_blocksize;
134     }
135    
136     /**
137     \brief
138     returns the solution u of the linear system this*u=in
139     */
140 woo409 757 ESCRIPT_DLL_API
141 jgs 153 Data solve(Data& in,const boost::python::dict& options) const;
142 jgs 82
143 jgs 102 /**
144     \brief writes the matrix to a file using the Matrix Market file format
145     */
146 woo409 757 ESCRIPT_DLL_API
147 jgs 102 virtual void saveMM(const std::string& fileName) const;
148 jgs 123
149 jgs 102 /**
150 jgs 123 \brief writes the matrix to a file using the Harwell-Boeing file format
151     */
152 woo409 757 ESCRIPT_DLL_API
153 jgs 123 virtual void saveHB(const std::string& fileName) const;
154    
155     /**
156 jgs 149 \brief resets the matrix entries
157 jgs 102 */
158 woo409 757 ESCRIPT_DLL_API
159 jgs 149 virtual void resetValues() const;
160 jgs 102
161 jgs 82 protected:
162    
163     private:
164    
165     /**
166     \brief
167     solves the linear system this*out=in
168     */
169 woo409 757 ESCRIPT_DLL_API
170 jgs 153 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
171 jgs 82
172     /**
173     \brief
174     performs y+=this*x
175     */
176 woo409 757 ESCRIPT_DLL_API
177 jgs 153 virtual void ypAx(Data& y,Data& x) const;
178 jgs 82
179     int m_empty;
180     int m_column_blocksize;
181     int m_row_blocksize;
182     FunctionSpace m_column_functionspace;
183     FunctionSpace m_row_functionspace;
184    
185     };
186    
187 woo409 757 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
188 jgs 82
189    
190    
191     } // end of namespace
192     #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26