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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (show annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 4 months ago) by jfenwick
File MIME type: text/plain
File size: 4037 byte(s)
Updating copyright notices
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 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
16 #define escript_AbstractSystemMatrix_20040628_H
17 #include "system_dep.h"
18
19 #include "FunctionSpace.h"
20 #include "SystemMatrixException.h"
21 #include <boost/python/object.hpp>
22 //
23 // Forward declaration
24 class Data;
25
26 namespace escript {
27
28 /**
29 \brief
30 Give a short description of what AbstractSystemMatrix does.
31
32 Description:
33 Give a detailed description of AbstractSystemMatrix
34
35 Template Parameters:
36 For templates describe any conditions that the parameters used in the
37 template must satisfy
38 */
39 class AbstractSystemMatrix {
40
41 public:
42
43 /**
44 \brief
45 Default constructor for AbstractSystemMatrix
46
47 Description:
48 Default constructor for AbstractSystemMatrix
49
50 Preconditions:
51 Describe any preconditions
52
53 Throws:
54 Describe any exceptions thrown
55 */
56 ESCRIPT_DLL_API
57 AbstractSystemMatrix();
58
59 ESCRIPT_DLL_API
60 AbstractSystemMatrix(const int row_blocksize,
61 const FunctionSpace& row_functionspace,
62 const int column_blocksize,
63 const FunctionSpace& column_functionspace);
64 /**
65 \brief
66 Destructor.
67 */
68 ESCRIPT_DLL_API
69 virtual ~AbstractSystemMatrix();
70
71 /**
72 \brief
73 matrix*vector multiplication
74 */
75 ESCRIPT_DLL_API
76 Data vectorMultiply(Data& right) const;
77
78 /**
79 \brief
80 returns true if the matrix is empty
81 */
82 ESCRIPT_DLL_API
83 int isEmpty() const;
84
85 /**
86 \brief
87 returns the column function space
88 */
89 ESCRIPT_DLL_API
90 inline FunctionSpace getColumnFunctionSpace() const
91 {
92 if (isEmpty())
93 throw SystemMatrixException("Error - Matrix is empty.");
94 return m_column_functionspace;
95 }
96
97 /**
98 \brief
99 returns the row function space
100 */
101 ESCRIPT_DLL_API
102 inline FunctionSpace getRowFunctionSpace() const
103 {
104 if (isEmpty())
105 throw SystemMatrixException("Error - Matrix is empty.");
106 return m_row_functionspace;
107 }
108
109 /**
110 \brief
111 returns the row block size
112 */
113 ESCRIPT_DLL_API
114 inline int getRowBlockSize() const
115 {
116 if (isEmpty())
117 throw SystemMatrixException("Error - Matrix is empty.");
118 return m_row_blocksize;
119 }
120
121 /**
122 \brief
123 returns the column block size
124 */
125 ESCRIPT_DLL_API
126 inline int getColumnBlockSize() const
127 {
128 if (isEmpty())
129 throw SystemMatrixException("Error - Matrix is empty.");
130 return m_column_blocksize;
131 }
132
133 /**
134 \brief
135 returns the solution u of the linear system this*u=in
136 */
137 ESCRIPT_DLL_API
138 Data solve(Data& in, boost::python::object& options) const;
139
140 /**
141 \brief writes the matrix to a file using the Matrix Market file format
142 */
143 ESCRIPT_DLL_API
144 virtual void saveMM(const std::string& fileName) const;
145
146 /**
147 \brief writes the matrix to a file using the Harwell-Boeing file format
148 */
149 ESCRIPT_DLL_API
150 virtual void saveHB(const std::string& fileName) const;
151
152 /**
153 \brief resets the matrix entries
154 */
155 ESCRIPT_DLL_API
156 virtual void resetValues() const;
157
158 protected:
159
160 private:
161
162 /**
163 \brief
164 solves the linear system this*out=in
165 */
166 ESCRIPT_DLL_API
167 virtual void setToSolution(Data& out,Data& in, boost::python::object& options) const;
168
169 /**
170 \brief
171 performs y+=this*x
172 */
173 ESCRIPT_DLL_API
174 virtual void ypAx(Data& y,Data& x) const;
175
176 int m_empty;
177 int m_column_blocksize;
178 int m_row_blocksize;
179 FunctionSpace m_row_functionspace;
180 FunctionSpace m_column_functionspace;
181
182
183 };
184
185 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
186
187
188
189 } // end of namespace
190 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26