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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 6 months ago) by ksteube
File MIME type: text/plain
File size: 4077 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

1
2 /* $Id$ */
3
4 /*******************************************************
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 #if !defined escript_AbstractSystemMatrix_20040628_H
17 #define escript_AbstractSystemMatrix_20040628_H
18 #include "system_dep.h"
19
20 #include "FunctionSpace.h"
21 #include "SystemMatrixException.h"
22
23 #include <boost/python/dict.hpp>
24
25 //
26 // Forward declaration
27 class Data;
28
29 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 ESCRIPT_DLL_API
60 AbstractSystemMatrix();
61
62 ESCRIPT_DLL_API
63 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 ESCRIPT_DLL_API
72 virtual ~AbstractSystemMatrix();
73
74 /**
75 \brief
76 matrix*vector multiplication
77 */
78 ESCRIPT_DLL_API
79 Data vectorMultiply(Data& right) const;
80
81 /**
82 \brief
83 returns true if the matrix is empty
84 */
85 ESCRIPT_DLL_API
86 int isEmpty() const;
87
88 /**
89 \brief
90 returns the column function space
91 */
92 ESCRIPT_DLL_API
93 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 ESCRIPT_DLL_API
105 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 ESCRIPT_DLL_API
117 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 ESCRIPT_DLL_API
129 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 ESCRIPT_DLL_API
141 Data solve(Data& in,const boost::python::dict& options) const;
142
143 /**
144 \brief writes the matrix to a file using the Matrix Market file format
145 */
146 ESCRIPT_DLL_API
147 virtual void saveMM(const std::string& fileName) const;
148
149 /**
150 \brief writes the matrix to a file using the Harwell-Boeing file format
151 */
152 ESCRIPT_DLL_API
153 virtual void saveHB(const std::string& fileName) const;
154
155 /**
156 \brief resets the matrix entries
157 */
158 ESCRIPT_DLL_API
159 virtual void resetValues() const;
160
161 protected:
162
163 private:
164
165 /**
166 \brief
167 solves the linear system this*out=in
168 */
169 ESCRIPT_DLL_API
170 virtual void setToSolution(Data& out,Data& in,const boost::python::dict& options) const;
171
172 /**
173 \brief
174 performs y+=this*x
175 */
176 ESCRIPT_DLL_API
177 virtual void ypAx(Data& y,Data& x) const;
178
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 ESCRIPT_DLL_API Data operator*(const AbstractSystemMatrix& left,const Data& right) ;
188
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